/* ============================================================
   WA History — Frontend Stylesheet
   Shared across all CPT templates.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

/* ============================================================
   Tokens
   ============================================================ */

:root {
	--wa-dark:       #2a2a2a;
	--wa-red:        #e40d41;
	--wa-light-grey: #f4f5f7;
	--wa-mid-grey:   #6b7280;
	--wa-border:     #dde1e7;
	--wa-white:      #ffffff;
	--wa-font-sans:  'Outfit', system-ui, -apple-system, sans-serif;
	--wa-max-width:  1320px;
}

/* ============================================================
   Base
   ============================================================ */

html {
	scroll-behavior: smooth;
}

body {
	font-family: var(--wa-font-sans);
}

/* Consistent focus ring across all interactive elements */
:focus-visible {
	outline: 2px solid var(--wa-red);
	outline-offset: 3px;
	border-radius: 2px;
}

.wa-archive,
.wa-single {
	padding: 2rem 2rem;
	max-width: var(--wa-max-width);
	margin: 0 auto;
}

/* ============================================================
   Display headings
   ============================================================ */

.wa-archive__title,
.wa-single__title,
.wa-section-heading {
	letter-spacing: -0.01em;
	color: var(--wa-dark);
	text-wrap: balance;
}

/* ============================================================
   Divider line — hand-drawn brush stroke via inline SVG path
   ============================================================ */

.wa-divider {
	height: 14px;
	width: 50%;
	border: none;
	margin: 0.75rem 0 2rem;
	/* Filled brush-stroke shape: blunt left edge, tapers to a point on the right,
	   top and bottom edges offset slightly for a natural painted feel */
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1000 14' preserveAspectRatio='none'%3E%3Cpath d='M0,2 C100,1 300,3 500,2.5 C700,2 850,4 997,7 C850,10.5 700,12 500,11.5 C300,11 100,13 0,12 Z' fill='%23e40d41'/%3E%3C/svg%3E") no-repeat left center / 100% 100%;
}

/* ============================================================
   Section headings (within single pages)
   ============================================================ */

.wa-section-heading {
	font-size: 1.35rem;
	border-bottom: none;
	padding-bottom: 0;
	margin: 2.5rem 0 0.25rem;
}

.wa-section-heading + .wa-divider {
	width: 33%;
	margin-top: 0;
	margin-bottom: 1.25rem;
}

/* ============================================================
   Archive header
   ============================================================ */

.wa-archive__header {
	margin-bottom: 0.5rem;
}

.wa-archive__title {
	font-size: clamp(1.75rem, 4vw, 2.5rem);
	margin: 0 0 0.2rem;
	letter-spacing: -0.02em;
}

.wa-archive__count {
	color: var(--wa-mid-grey);
	font-size: 0.9rem;
	margin-bottom: 0.5rem;
}

/* ============================================================
   Filters — red background
   ============================================================ */

.wa-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	align-items: flex-end;
	background: var(--wa-red);
	border-radius: 6px;
	padding: 1.25rem;
	margin-bottom: 2rem;
}

.wa-filters__group {
	display: flex;
	flex-direction: column;
	gap: 0.3rem;
	flex: 1;
	min-width: 150px;
}

.wa-filters__label {
	font-size: 0.72rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.07em;
	color: rgba(255, 255, 255, 0.8);
}

.wa-filters__input,
.wa-filters__select {
	padding: 0.5rem 0.75rem;
	border: 1px solid rgba(255, 255, 255, 0.3);
	border-radius: 4px;
	font-size: 0.9rem;
	background: rgba(255, 255, 255, 0.15);
	color: var(--wa-white);
}

.wa-filters__input::placeholder {
	color: rgba(255, 255, 255, 0.55);
}

/* Dropdown options need a solid bg so they're readable */
.wa-filters__select option {
	background: var(--wa-dark);
	color: var(--wa-white);
}

.wa-filters__submit {
	padding: 0.5rem 1.5rem;
	background: var(--wa-white);
	color: var(--wa-red);
	border: none;
	border-radius: 4px;
	font-size: 1rem;
	font-weight: 700;
	font-family: var(--wa-font-sans);
	letter-spacing: 0.03em;
	cursor: pointer;
	align-self: flex-end;
	transition: background 0.15s, color 0.15s, transform 0.1s;
}

.wa-filters__submit:hover {
	background: var(--wa-dark);
	color: var(--wa-white);
}

.wa-filters__submit:active {
	transform: scale(0.97) translateY(1px);
}

.wa-filters__reset {
	font-size: 0.85rem;
	color: rgba(255, 255, 255, 0.7);
	text-decoration: underline;
	align-self: flex-end;
	padding-bottom: 0.5rem;
}

.wa-filters__reset:hover {
	color: var(--wa-white);
}

/* ============================================================
   Tables
   ============================================================ */

.wa-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.9rem;
	font-variant-numeric: tabular-nums;
}

.wa-table thead {
	background: var(--wa-dark);
	color: var(--wa-white);
}

.wa-table thead th {
	padding: 0.75rem 1rem;
	text-align: left;
	font-size: 0.85rem;
	letter-spacing: 0.06em;
	font-weight: 600;
}

.wa-table tbody tr {
	border-bottom: 1px solid var(--wa-border);
	transition: background 0.12s;
}

.wa-table tbody tr:hover {
	background: var(--wa-light-grey);
}

.wa-table td {
	padding: 0.7rem 1rem;
	vertical-align: middle;
}

.wa-table__name a {
	font-weight: 600;
	color: var(--wa-dark);
	text-decoration: none;
}

.wa-table__name a:hover {
	color: var(--wa-red);
	text-decoration: underline;
}

/* ============================================================
   Status badges
   ============================================================ */

.wa-status {
	display: inline-block;
	padding: 0.2rem 0.6rem;
	border-radius: 20px;
	font-size: 0.72rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.wa-status--active    { background: #d1fae5; color: #065f46; }
.wa-status--retired   { background: #e0e7ff; color: #3730a3; }
.wa-status--deceased  { background: #f3f4f6; color: #374151; }
.wa-status--inactive  { background: #f3f4f6; color: #374151; }
.wa-status--merged    { background: #e0e7ff; color: #3730a3; }
.wa-status--dissolved { background: #fee2e2; color: #991b1b; }

/* ============================================================
   Breadcrumb
   ============================================================ */

.wa-breadcrumb {
	font-size: 0.85rem;
	color: var(--wa-mid-grey);
	margin-bottom: 1.5rem;
}

.wa-breadcrumb a {
	color: var(--wa-mid-grey);
	text-decoration: none;
}

.wa-breadcrumb a:hover { color: var(--wa-red); }
.wa-breadcrumb span   { margin: 0 0.4rem; }

/* ============================================================
   Dummy data notice
   ============================================================ */

.wa-dummy-notice {
	background: #fffbeb;
	border: 1px solid #fcd34d;
	border-radius: 6px;
	padding: 0.75rem 1rem;
	font-size: 0.85rem;
	color: #92400e;
	margin-bottom: 1.5rem;
}

/* ============================================================
   No results
   ============================================================ */

.wa-no-results {
	text-align: center;
	padding: 3rem;
	color: var(--wa-mid-grey);
}

/* ============================================================
   Pill Tabs — Welsh Records and similar pages
   ============================================================ */

.wa-tabs {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	margin-bottom: 2.5rem;
	align-items: center;
}

.wa-tabs__group {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	justify-content: center;
	width: 100%;
}

.wa-tabs__separator {
	width: 60%;
	height: 1px;
	background: var(--wa-border);
	margin: 0.1rem 0;
}

.wa-tabs__pill {
	display: inline-block;
	padding: 0.4rem 1rem;
	border-radius: 999px;
	border: 2px solid var(--wa-border);
	background: var(--wa-white);
	color: var(--wa-dark);
	font-size: 0.82rem;
	font-weight: 600;
	letter-spacing: 0.03em;
	cursor: pointer;
	text-decoration: none;
	transition: background 0.15s, border-color 0.15s, color 0.15s;
	white-space: nowrap;
}

.wa-tabs__pill:hover {
	border-color: var(--wa-red);
	color: var(--wa-red);
}

.wa-tabs__pill:active {
	transform: scale(0.97);
}

.wa-tabs__pill--active {
	background: var(--wa-red);
	border-color: var(--wa-red);
	color: var(--wa-white);
}

.wa-tabs__pill--active:hover {
	background: var(--wa-red);
	border-color: var(--wa-red);
	color: var(--wa-white);
}

.wa-tab-panel {
	display: none;
}

.wa-tab-panel--active {
	display: block;
}

/* ============================================================
   Service Awards — criteria block and year groups
   ============================================================ */

.wa-award-criteria {
	background: var(--wa-light-grey, #f5f5f5);
	border-left: 4px solid var(--wa-red, #c00);
	padding: 1.25rem 1.5rem;
	margin: 1.5rem 0;
	border-radius: 0 4px 4px 0;
}

.wa-award-criteria__title {
	font-size: 0.8rem;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	margin: 0 0 0.6rem;
	color: var(--wa-mid-grey, #666);
}

.wa-award-criteria__text {
	margin: 0;
	font-size: 0.9rem;
	line-height: 1.6;
}

.wa-award-year {
	margin: 2rem 0;
}

.wa-award-year__heading {
	font-size: 1.1rem;
	font-weight: 700;
	border-bottom: 2px solid var(--wa-red, #c00);
	padding-bottom: 0.35rem;
	margin: 0 0 0.75rem;
}

.wa-award-year__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem 1.5rem;
}

.wa-award-year__item {
	font-size: 0.95rem;
}

.wa-award-year__item a {
	color: inherit;
	text-decoration: none;
}

.wa-award-year__item a:hover {
	color: var(--wa-red, #c00);
	text-decoration: underline;
}

.wa-award-year__notes {
	font-size: 0.8rem;
	color: var(--wa-mid-grey, #666);
	margin-left: 0.3em;
}

/* ============================================================
   Age group filter bar — Welsh Records page
   ============================================================ */

.wa-age-filter {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	flex-wrap: wrap;
	margin-bottom: 2rem;
	padding: 0.75rem 1rem;
	background: var(--wa-light-grey);
	border-radius: 6px;
	border: 1px solid var(--wa-border);
}

.wa-age-filter__label {
	font-size: 0.75rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.07em;
	color: var(--wa-mid-grey);
	white-space: nowrap;
}

.wa-age-filter__pills {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
}

.wa-age-filter__pill {
	padding: 0.3rem 0.85rem;
	border-radius: 999px;
	border: 2px solid var(--wa-border);
	background: var(--wa-white);
	color: var(--wa-dark);
	font-size: 0.8rem;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s, border-color 0.15s, color 0.15s;
	white-space: nowrap;
}

.wa-age-filter__pill:hover {
	border-color: var(--wa-red);
	color: var(--wa-red);
}

.wa-age-filter__pill--active {
	background: var(--wa-dark);
	border-color: var(--wa-dark);
	color: var(--wa-white);
}

/* ============================================================
   Age group badges — table cells
   ============================================================ */

.wa-age-badge {
	display: inline-block;
	padding: 0.2rem 0.55rem;
	border-radius: 4px;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	background: var(--wa-light-grey);
	color: var(--wa-dark);
}

.wa-age-badge--senior   { background: #2e2e2e; color: #fff; }
.wa-age-badge--u23      { background: #1e3a5f; color: #fff; }
.wa-age-badge--u20      { background: #1d4ed8; color: #fff; }
.wa-age-badge--u18      { background: #0369a1; color: #fff; }
.wa-age-badge--u17      { background: #0891b2; color: #fff; }
.wa-age-badge--u15      { background: #059669; color: #fff; }
.wa-age-badge--u13      { background: #7c3aed; color: #fff; }

/* Wind column */
.wa-table__wind {
	color: var(--wa-mid-grey);
	font-size: 0.85rem;
	white-space: nowrap;
}

.wa-table__wind--nil {
	color: var(--wa-border);
}

/* Date column — consistent width */
.wa-table__date {
	white-space: nowrap;
	color: var(--wa-mid-grey);
	font-size: 0.85rem;
}

/* ============================================================
   Responsive
   ============================================================ */

@media ( max-width: 640px ) {
	.wa-archive__title { font-size: 1.75rem; }
	.wa-filters { gap: 0.5rem; }
	.wa-filters__group { min-width: 100%; }
	.wa-tabs__pill { font-size: 0.78rem; padding: 0.35rem 0.8rem; }
}
