/**
 * FC Brownsville - Reusable UI Components
 *
 * Buttons, cards, badges, forms, alerts, and utility components.
 * Energetic youth soccer theme — gold #C9A961 & black #000000.
 * Uses CSS custom properties from variables.css.
 * All components follow WCAG 2.1 AA accessibility standards.
 *
 * @package FC_Brownsville
 * @since   2.0.0
 */

/* =============================================================
   BASE RESET & GLOBALS
   ============================================================= */

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

body {
	font-family: var(--font-primary);
	font-size: var(--fs-base);
	line-height: var(--lh-base);
	color: var(--fc-black);
	background-color: var(--fc-white);
}

h1, h2, h3, h4, h5, h6 {
	font-family: var(--font-headings);
	font-weight: var(--fw-bold);
	line-height: var(--lh-tight);
	color: var(--fc-black);
}

/* =============================================================
   SKIP LINK (Accessibility)
   ============================================================= */

.fc-skip-link {
	position: absolute;
	top: -100%;
	left: 50%;
	transform: translateX(-50%);
	background: var(--fc-black);
	color: var(--fc-white);
	padding: var(--space-sm) var(--space-lg);
	font-size: var(--fs-sm);
	font-weight: var(--fw-semibold);
	text-decoration: none;
	border-radius: 0 0 var(--radius-md) var(--radius-md);
	z-index: var(--z-toast);
	transition: top var(--transition-fast);
}

.fc-skip-link:focus {
	top: 0;
	outline: var(--fc-focus-outline);
	outline-offset: var(--fc-focus-offset);
}

/* =============================================================
   CONTAINER
   ============================================================= */

.fc-container {
	width: 100%;
	max-width: var(--container-max);
	margin-inline: auto;
	padding-inline: var(--container-padding);
}

.fc-container--narrow {
	max-width: var(--container-narrow);
}

.fc-container--wide {
	max-width: var(--container-wide);
}

/* =============================================================
   SCREEN READER ONLY (Accessibility)
   ============================================================= */

.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* =============================================================
   BUTTONS
   ============================================================= */

.fc-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	padding: 12px 24px;
	font-family: var(--font-primary);
	font-size: var(--fs-sm);
	font-weight: var(--fw-semibold);
	line-height: 1;
	text-decoration: none;
	border: 2px solid transparent;
	border-radius: var(--radius-sm);
	cursor: pointer;
	transition: all var(--transition-fast);
	white-space: nowrap;
	min-height: 44px;
}

.fc-btn:focus-visible {
	outline: var(--fc-focus-outline);
	outline-offset: var(--fc-focus-offset);
}

/* Primary — gold background */
.fc-btn--primary {
	background: var(--fc-gold);
	color: var(--fc-black);
	border-color: var(--fc-gold);
}

.fc-btn--primary:hover {
	background: var(--fc-gold-dark);
	border-color: var(--fc-gold-dark);
}

/* Secondary — outline on dark backgrounds */
.fc-btn--secondary {
	background: transparent;
	color: var(--fc-white);
	border-color: var(--fc-gold);
}

.fc-btn--secondary:hover {
	background: var(--fc-gold);
	color: var(--fc-black);
}

/* Secondary Dark — outline on light backgrounds */
.fc-btn--secondary-dark {
	background: transparent;
	color: var(--fc-black);
	border-color: var(--fc-black);
}

.fc-btn--secondary-dark:hover {
	background: var(--fc-black);
	color: var(--fc-white);
}

/* Ghost — minimal text-only link style */
.fc-btn--ghost {
	background: transparent;
	color: var(--fc-gold);
	border-color: transparent;
	padding: 0;
	text-decoration: underline;
	text-underline-offset: 4px;
}

.fc-btn--ghost:hover {
	color: var(--fc-gold-dark);
}

/* Size variants */
.fc-btn--sm {
	padding: 8px 16px;
	font-size: var(--fs-xs);
}

.fc-btn--lg {
	padding: 16px 32px;
	font-size: var(--fs-md);
}

/* Disabled state */
.fc-btn:disabled,
.fc-btn[aria-disabled="true"] {
	opacity: 0.5;
	cursor: not-allowed;
	pointer-events: none;
}

/* =============================================================
   CARDS
   ============================================================= */

.fc-card {
	background: var(--fc-white);
	border-radius: var(--radius-md);
	padding: 24px;
	box-shadow: var(--shadow-md);
	transition: all var(--transition-base);
}

.fc-card:hover {
	box-shadow: var(--shadow-lg);
	transform: translateY(-4px);
}

.fc-card--bordered {
	border-left: 4px solid var(--fc-gold);
}

.fc-card__image {
	width: calc(100% + 48px);
	margin: -24px -24px var(--space-lg);
	border-radius: var(--radius-md) var(--radius-md) 0 0;
	object-fit: cover;
	aspect-ratio: 16 / 9;
	display: block;
}

.fc-card__icon {
	font-size: 3rem;
	margin-bottom: var(--space-md);
	display: block;
}

.fc-card__title {
	font-family: var(--font-headings);
	font-size: var(--fs-lg);
	font-weight: var(--fw-bold);
	color: var(--fc-black);
	margin-bottom: var(--space-sm);
}

.fc-card__title a {
	color: inherit;
	text-decoration: none;
}

.fc-card__title a:hover {
	color: var(--fc-gold);
}

.fc-card__desc {
	font-size: var(--fs-base);
	color: var(--fc-gray-700);
	margin-bottom: var(--space-lg);
	line-height: var(--lh-base);
}

.fc-card__link {
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
	background: transparent;
	color: var(--fc-gold);
	border: none;
	padding: 0;
	font-family: var(--font-primary);
	font-size: var(--fs-sm);
	font-weight: var(--fw-semibold);
	text-decoration: underline;
	text-underline-offset: 4px;
	cursor: pointer;
	transition: color var(--transition-fast);
}

.fc-card__link:hover {
	color: var(--fc-gold-dark);
}

.fc-card__meta {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-sm);
	font-size: var(--fs-xs);
	color: var(--fc-gray-500);
	margin-bottom: var(--space-md);
}

/* Legacy card sub-elements (backward compat) */
.fc-card__body {
	padding: var(--space-lg);
}

.fc-card__excerpt {
	font-size: var(--fs-sm);
	color: var(--fc-gray-700);
	margin-bottom: var(--space-lg);
}

.fc-card__footer {
	padding: var(--space-md) var(--space-lg);
	border-top: 1px solid var(--fc-gray-300);
	display: flex;
	justify-content: space-between;
	align-items: center;
}

/* =============================================================
   EVENT CARD VARIANT
   ============================================================= */

.fc-card--event {
	display: flex;
	gap: var(--space-lg);
	align-items: flex-start;
}

.fc-card--event .fc-card__date {
	flex-shrink: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	background: var(--fc-gold);
	color: var(--fc-black);
	padding: 8px 12px;
	border-radius: var(--radius-md);
	min-width: 60px;
	text-align: center;
}

.fc-card--event .fc-card__date-month {
	font-size: var(--fs-xs);
	font-weight: var(--fw-bold);
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.fc-card--event .fc-card__date-day {
	font-size: var(--fs-2xl);
	font-weight: var(--fw-bold);
	line-height: 1;
}

/* Program Card Variant */
.fc-card--program {
	border-left: 4px solid var(--fc-gold);
}

/* =============================================================
   BADGES
   ============================================================= */

.fc-badge {
	display: inline-flex;
	align-items: center;
	padding: 4px 12px;
	font-size: var(--fs-xs);
	font-weight: var(--fw-semibold);
	border-radius: var(--radius-full);
	line-height: 1;
}

.fc-badge--gold {
	background: var(--fc-gold);
	color: var(--fc-black);
}

.fc-badge--black {
	background: var(--fc-black);
	color: var(--fc-white);
}

.fc-badge--green {
	background: var(--fc-accent-green);
	color: var(--fc-white);
}

.fc-badge--red {
	background: var(--fc-accent-red);
	color: var(--fc-white);
}

/* Semantic aliases */
.fc-badge--league {
	background: var(--fc-black);
	color: var(--fc-white);
}

.fc-badge--academy {
	background: var(--fc-gold);
	color: var(--fc-black);
}

.fc-badge--indoor {
	background: var(--fc-info);
	color: var(--fc-white);
}

.fc-badge--free {
	background: var(--fc-success);
	color: var(--fc-white);
}

/* =============================================================
   FORMS
   ============================================================= */

.fc-form__group {
	margin-bottom: var(--space-lg);
}

.fc-form__label {
	display: block;
	font-size: var(--fs-sm);
	font-weight: var(--fw-semibold);
	color: var(--fc-black);
	margin-bottom: var(--space-xs);
}

.fc-form__label--required::after {
	content: " *";
	color: var(--fc-accent-red);
}

.fc-form__input,
.fc-form__select,
.fc-form__textarea {
	width: 100%;
	height: 44px;
	padding: 0 var(--space-md);
	font-family: var(--font-primary);
	font-size: var(--fs-base);
	color: var(--fc-black);
	background: var(--fc-white);
	border: 2px solid var(--fc-gray-300);
	border-radius: var(--radius-md);
	transition:
		border-color var(--transition-fast),
		box-shadow var(--transition-fast);
}

.fc-form__textarea {
	height: auto;
	min-height: 120px;
	padding: var(--space-sm) var(--space-md);
	resize: vertical;
}

.fc-form__input:focus,
.fc-form__select:focus,
.fc-form__textarea:focus {
	border-color: var(--fc-gold);
	outline: none;
	box-shadow: 0 0 0 3px rgba(201, 169, 97, 0.25);
}

.fc-form__input[aria-invalid="true"],
.fc-form__select[aria-invalid="true"],
.fc-form__textarea[aria-invalid="true"] {
	border-color: var(--fc-error);
}

.fc-form__error {
	display: none;
	font-size: var(--fs-xs);
	color: var(--fc-error);
	margin-top: var(--space-xs);
}

.fc-form__input[aria-invalid="true"] + .fc-form__error,
.fc-form__select[aria-invalid="true"] + .fc-form__error,
.fc-form__textarea[aria-invalid="true"] + .fc-form__error {
	display: block;
}

.fc-form__help {
	font-size: var(--fs-xs);
	color: var(--fc-gray-500);
	margin-top: var(--space-xs);
}

/* Checkbox — used for GDPR consent */
.fc-form__checkbox {
	display: flex;
	align-items: flex-start;
	gap: var(--space-sm);
	cursor: pointer;
}

.fc-form__checkbox input[type="checkbox"] {
	width: 20px;
	height: 20px;
	accent-color: var(--fc-gold);
	cursor: pointer;
	flex-shrink: 0;
	margin-top: 2px;
}

.fc-form__checkbox span {
	font-size: var(--fs-sm);
	color: var(--fc-gray-700);
}

/* =============================================================
   ALERTS / NOTICES
   ============================================================= */

.fc-alert {
	padding: var(--space-md) var(--space-lg);
	border-radius: var(--radius-md);
	font-size: var(--fs-sm);
	border-left: 4px solid;
}

.fc-alert--success {
	background: #e8f5e9;
	border-color: var(--fc-success);
	color: #1b5e20;
}

.fc-alert--error {
	background: #ffebee;
	border-color: var(--fc-error);
	color: #b71c1c;
}

.fc-alert--info {
	background: #e3f2fd;
	border-color: var(--fc-info);
	color: #0d47a1;
}

.fc-alert[role="alert"] {
	animation: fc-slide-in var(--transition-base);
}

@keyframes fc-slide-in {
	from {
		opacity: 0;
		transform: translateY(-8px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* =============================================================
   SPINNER
   ============================================================= */

.fc-spinner {
	display: inline-block;
	width: 20px;
	height: 20px;
	border: 3px solid rgba(0, 0, 0, 0.15);
	border-top-color: currentColor;
	border-radius: 50%;
	animation: fc-spin 0.6s linear infinite;
}

@keyframes fc-spin {
	to {
		transform: rotate(360deg);
	}
}

/* =============================================================
   QUANTITY INPUT
   ============================================================= */

.fc-qty {
	display: flex;
	align-items: center;
	border: 2px solid var(--fc-gray-300);
	border-radius: var(--radius-md);
	overflow: hidden;
}

.fc-qty__btn {
	width: 44px;
	height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--fc-gray-100);
	border: none;
	font-size: var(--fs-lg);
	cursor: pointer;
	color: var(--fc-black);
	transition: background var(--transition-fast);
}

.fc-qty__btn:hover {
	background: var(--fc-gray-300);
}

.fc-qty__input {
	width: 48px;
	height: 44px;
	text-align: center;
	border: none;
	font-size: var(--fs-base);
	font-weight: var(--fw-semibold);
	outline: none;
	-moz-appearance: textfield;
}

.fc-qty__input::-webkit-inner-spin-button,
.fc-qty__input::-webkit-outer-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

/* =============================================================
   ORDER SUMMARY
   ============================================================= */

.fc-order-summary__item {
	display: flex;
	justify-content: space-between;
	padding: var(--space-sm) 0;
	border-bottom: 1px solid var(--fc-gray-300);
	font-size: var(--fs-sm);
}

.fc-order-summary__total {
	display: flex;
	justify-content: space-between;
	padding-top: var(--space-md);
	font-size: var(--fs-lg);
	font-weight: var(--fw-bold);
	border-top: 2px solid var(--fc-black);
}

.fc-order-summary__empty {
	text-align: center;
	padding: var(--space-xl) 0;
	color: var(--fc-gray-500);
	font-size: var(--fs-sm);
}

/* =============================================================
   GRID LAYOUTS
   ============================================================= */

.fc-grid {
	display: grid;
	gap: var(--space-xl);
}

.fc-grid--2 {
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
}

.fc-grid--3 {
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
}

.fc-grid--4 {
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
}

/* =============================================================
   SECTION LAYOUT
   ============================================================= */

.fc-section {
	padding-block: var(--space-4xl);
}

.fc-section--dark {
	background-color: var(--fc-black);
	color: var(--fc-white);
}

.fc-section--light {
	background-color: var(--fc-gray-100);
}

.fc-section__header {
	text-align: center;
	margin-bottom: var(--space-3xl);
}

.fc-section__title {
	font-size: var(--fs-2xl);
	margin-bottom: var(--space-sm);
}

.fc-section--dark .fc-section__title {
	color: var(--fc-white);
}

.fc-section__subtitle {
	font-size: var(--fs-md);
	color: var(--fc-gray-500);
	max-width: 600px;
	margin-inline: auto;
}

/* =============================================================
   HERO SECTION
   ============================================================= */

.fc-hero {
	position: relative;
	min-height: 80vh;
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	background-color: var(--fc-black);
	color: var(--fc-white);
	overflow: hidden;
}

.fc-hero__background {
	position: absolute;
	inset: 0;
	z-index: 0;
}

.fc-hero__background img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	opacity: 0.4;
}

.fc-hero__content {
	position: relative;
	z-index: 1;
	max-width: var(--container-narrow);
	padding: var(--space-xl) var(--container-padding);
}

.fc-hero__title {
	font-size: var(--fs-3xl);
	color: var(--fc-white);
	margin-bottom: var(--space-md);
}

.fc-hero__subtitle {
	font-size: var(--fs-lg);
	color: var(--fc-gold-light);
	margin-bottom: var(--space-xl);
}

.fc-hero__actions {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-md);
	justify-content: center;
}

/* =============================================================
   QUICK LINKS GRID
   ============================================================= */

.fc-quick-links {
	list-style: none;
	padding: 0;
	margin: 0;
}

.fc-quick-link {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	padding: var(--space-xl);
	background: var(--fc-white);
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow-sm);
	text-decoration: none;
	color: var(--fc-black);
	transition: box-shadow var(--transition-base), transform var(--transition-base);
}

.fc-quick-link:hover {
	box-shadow: var(--shadow-lg);
	transform: translateY(-4px);
}

.fc-quick-link:focus-visible {
	outline: var(--fc-focus-outline);
	outline-offset: var(--fc-focus-offset);
}

.fc-quick-link__icon {
	font-size: 2.5rem;
	margin-bottom: var(--space-md);
	color: var(--fc-gold);
}

.fc-quick-link__title {
	font-family: var(--font-headings);
	font-size: var(--fs-md);
	font-weight: var(--fw-bold);
	margin-bottom: var(--space-xs);
}

.fc-quick-link__desc {
	font-size: var(--fs-sm);
	color: var(--fc-gray-500);
}

/* =============================================================
   TIMELINE (TX Futures)
   ============================================================= */

.fc-timeline {
	position: relative;
	padding-left: var(--space-2xl);
}

.fc-timeline::before {
	content: '';
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	width: 3px;
	background: var(--fc-gold);
}

.fc-timeline__item {
	position: relative;
	padding-bottom: var(--space-2xl);
}

.fc-timeline__item::before {
	content: '';
	position: absolute;
	left: calc(-1 * var(--space-2xl) - 6px);
	top: 4px;
	width: 15px;
	height: 15px;
	background: var(--fc-gold);
	border: 3px solid var(--fc-white);
	border-radius: 50%;
}

.fc-timeline__date {
	font-size: var(--fs-xs);
	font-weight: var(--fw-semibold);
	color: var(--fc-gold);
	text-transform: uppercase;
	letter-spacing: 0.05em;
	margin-bottom: var(--space-xs);
}

.fc-timeline__title {
	font-size: var(--fs-lg);
	margin-bottom: var(--space-sm);
}

.fc-timeline__desc {
	font-size: var(--fs-sm);
	color: var(--fc-gray-700);
}

/* =============================================================
   NEWSLETTER SIGNUP (Footer)
   ============================================================= */

.fc-newsletter {
	display: flex;
	gap: var(--space-sm);
	max-width: 480px;
}

.fc-newsletter__input {
	flex: 1;
	padding: var(--space-sm) var(--space-md);
	border: 2px solid rgba(255, 255, 255, 0.3);
	border-radius: var(--radius-md);
	background: rgba(255, 255, 255, 0.1);
	color: var(--fc-white);
	font-size: var(--fs-sm);
}

.fc-newsletter__input::placeholder {
	color: rgba(255, 255, 255, 0.6);
}

.fc-newsletter__input:focus {
	border-color: var(--fc-gold);
	outline: none;
	box-shadow: 0 0 0 3px rgba(201, 169, 97, 0.25);
}
