/* ==========================================================================
   AF Cases — Public Styles
   Font: Quicksand (loaded by plugin)
   Palette: accent #fc791a | heading #122f2a | text #333
   ========================================================================== */

:root {
	--afc-font:        'Quicksand', sans-serif;
	--afc-accent:      #fc791a;
	--afc-heading:     #122f2a;
	--afc-text:        #444;
	--afc-muted:       #888;
	--afc-border:      #e8e8e8;
	--afc-bg-light:    #f8f8f8;
	--afc-radius:      12px;
	--afc-radius-sm:   8px;
	--afc-shadow:      0 4px 20px rgba(0, 0, 0, .08);
	--afc-shadow-hov:  0 8px 32px rgba(0, 0, 0, .14);
	--afc-transition:  .22s ease;
}

/* ==========================================================================
   SHARED
   ========================================================================== */
.afc-wrapper,
.afc-single-wrap {
	font-family: var(--afc-font);
	color: var(--afc-text);
	-webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   CASES GRID PAGE
   ========================================================================== */

/* Search bar
   -------------------------------------------------------------------------- */
.afc-search-bar {
	margin-bottom: 28px;
}

.afc-search-inner {
	position: relative;
	max-width: 520px;
	margin-bottom: 16px;
}

.afc-search-icon {
	position: absolute;
	left: 14px;
	top: 50%;
	transform: translateY(-50%);
	color: var(--afc-muted);
	pointer-events: none;
	display: flex;
}

.afc-search-input {
	width: 100%;
	padding: 12px 16px 12px 44px;
	border: 2px solid var(--afc-border);
	border-radius: 50px;
	font-family: var(--afc-font);
	font-size: 15px;
	font-weight: 500;
	color: var(--afc-heading);
	background: #fff;
	outline: none;
	transition: border-color var(--afc-transition), box-shadow var(--afc-transition);
	box-sizing: border-box;
}

.afc-search-input:focus {
	border-color: var(--afc-accent);
	box-shadow: 0 0 0 3px rgba(252, 121, 26, .12);
}

.afc-search-spinner {
	position: absolute;
	right: 16px;
	top: 50%;
	transform: translateY(-50%);
	width: 18px;
	height: 18px;
	border: 2px solid var(--afc-border);
	border-top-color: var(--afc-accent);
	border-radius: 50%;
	display: none;
}

.afc-search-spinner.is-spinning {
	display: block;
	animation: afc-spin .7s linear infinite;
}

@keyframes afc-spin { to { transform: translateY(-50%) rotate(360deg); } }

/* Filter pills
   -------------------------------------------------------------------------- */
.afc-filter-pills {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.afc-pill {
	padding: 6px 18px;
	border-radius: 50px;
	border: 2px solid var(--afc-border);
	background: #fff;
	font-family: var(--afc-font);
	font-size: 13px;
	font-weight: 600;
	color: var(--afc-muted);
	cursor: pointer;
	transition: all var(--afc-transition);
	line-height: 1.4;
}

.afc-pill:hover,
.afc-pill--active {
	border-color: var(--afc-accent);
	background: var(--afc-accent);
	color: #fff;
}

/* Grid
   -------------------------------------------------------------------------- */
.afc-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
	gap: 24px;
}

@media (max-width: 480px) {
	.afc-grid { grid-template-columns: 1fr 1fr; gap: 14px; }
}

/* Card
   -------------------------------------------------------------------------- */
.afc-card {
	border-radius: var(--afc-radius);
	overflow: hidden;
	box-shadow: var(--afc-shadow);
	background: #fff;
	transition: transform var(--afc-transition), box-shadow var(--afc-transition);
}

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

.afc-card__link {
	display: block;
	text-decoration: none;
	color: inherit;
}

.afc-card__image-wrap {
	position: relative;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	background: var(--afc-bg-light);
}

.afc-card__image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform .4s ease;
}

.afc-card:hover .afc-card__image {
	transform: scale(1.04);
}

.afc-card__image-placeholder {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #ccc;
}

/* Status badge on card */
.afc-card__status {
	position: absolute;
	top: 10px;
	right: 10px;
	padding: 3px 10px;
	border-radius: 20px;
	font-size: 10px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .5px;
	backdrop-filter: blur(4px);
}

.afc-card__body {
	padding: 14px 16px 16px;
}

.afc-card__name {
	font-family: var(--afc-font);
	font-size: 16px;
	font-weight: 700;
	color: var(--afc-heading);
	margin: 0 0 6px;
	line-height: 1.3;
}

.afc-card__city {
	display: flex;
	align-items: center;
	gap: 5px;
	font-size: 13px;
	font-weight: 500;
	color: var(--afc-muted);
	margin: 0;
}

.afc-card__city svg { flex-shrink: 0; }

/* Status colours (shared grid + single) */
.afc-status--active             { background: #e6f4ea; color: #1e7e34; }
.afc-status--under_care         { background: #e3f2fd; color: #1565c0; }
.afc-status--completed          { background: #f3f3f3; color: #666;    }
.afc-status--on_hold            { background: #fff3e0; color: #e65100; }
.afc-status--tracing_family     { background: #fce4ec; color: #c62828; }
.afc-status--in_contact_family  { background: #e8f5e9; color: #2e7d32; }
.afc-status--returned_to_family { background: #ede7f6; color: #4527a0; }

/* Load more
   -------------------------------------------------------------------------- */
.afc-load-more-wrap {
	text-align: center;
	margin-top: 36px;
}

.afc-load-more-btn {
	padding: 12px 36px;
	border-radius: 50px;
	border: 2px solid var(--afc-accent);
	background: transparent;
	font-family: var(--afc-font);
	font-size: 14px;
	font-weight: 700;
	color: var(--afc-accent);
	cursor: pointer;
	transition: all var(--afc-transition);
}

.afc-load-more-btn:hover,
.afc-load-more-btn:focus {
	background: var(--afc-accent);
	color: #fff;
}

.afc-load-more-btn:disabled {
	opacity: .5;
	cursor: not-allowed;
}

/* No results
   -------------------------------------------------------------------------- */
.afc-no-results {
	grid-column: 1 / -1;
	text-align: center;
	font-size: 15px;
	font-weight: 500;
	color: var(--afc-muted);
	padding: 40px 0;
}

/* ==========================================================================
   SINGLE CASE PAGE — suppress theme chrome (featured image, post meta)
   ========================================================================== */

/* Hide theme-level featured image on single case pages */
body.single-afc_case .post-thumbnail,
body.single-afc_case .entry-thumbnail,
body.single-afc_case .wp-post-image,
body.single-afc_case figure.wp-block-post-featured-image { display: none !important; }

/* Hide "Written by / in / on" post meta on single case pages */
body.single-afc_case .entry-meta,
body.single-afc_case .post-meta,
body.single-afc_case .byline,
body.single-afc_case .posted-on,
body.single-afc_case .cat-links,
body.single-afc_case .tags-links,
body.single-afc_case .wp-block-post-author,
body.single-afc_case .wp-block-post-date,
body.single-afc_case .wp-block-post-terms { display: none !important; }

/* ==========================================================================
   SINGLE CASE PAGE
   ========================================================================== */

.afc-single {
	font-family: var(--afc-font);
	padding: 8px 0 48px;
	width: 70%;
	margin-left: auto;
	margin-right: auto;
	box-sizing: border-box;
}

@media (max-width: 900px) {
	.afc-single { width: 90%; }
}

@media (max-width: 600px) {
	.afc-single { width: 100%; }
}

/* Back link */
.afc-back {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font-size: 13px;
	font-weight: 600;
	color: var(--afc-accent);
	text-decoration: none;
	margin-bottom: 20px;
	transition: gap var(--afc-transition), opacity var(--afc-transition);
}

.afc-back:hover { opacity: .75; gap: 8px; }

/* ── Profile card (photo + name/status) ── */
.afc-profile-card {
	display: flex;
	align-items: center;
	gap: 24px;
	background: #fff;
	border: 1px solid var(--afc-border);
	border-radius: var(--afc-radius);
	padding: 24px;
	margin-bottom: 20px;
	box-shadow: var(--afc-shadow);
}

@media (max-width: 560px) {
	.afc-profile-card { flex-direction: column; align-items: flex-start; gap: 16px; }
}

/* Photo — thumbnail size, fixed square */
.afc-profile-photo {
	width: 150px;
	height: 150px;
	border-radius: 10px;
	overflow: hidden;
	flex-shrink: 0;
	background: var(--afc-bg-light);
}

.afc-profile-photo-link {
	display: block;
	width: 100%;
	height: 100%;
}

.afc-profile-photo-link:hover .afc-profile-img {
	opacity: .88;
	transition: opacity var(--afc-transition);
}

.afc-profile-photo--empty {
	display: flex;
	align-items: center;
	justify-content: center;
	border: 2px dashed var(--afc-border);
}

.afc-profile-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.afc-profile-placeholder { color: #ccc; }

/* Identity */
.afc-profile-identity { flex: 1; min-width: 0; }

.afc-profile-name {
	font-family: var(--afc-font);
	font-size: 32px;
	font-weight: 700;
	color: var(--afc-heading);
	line-height: 1.2;
	margin: 0 0 12px;
}

.afc-profile-meta {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px;
}

.afc-badge {
	display: inline-block;
	padding: 4px 14px;
	border-radius: 20px;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .5px;
}

.afc-profile-city {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-size: 13px;
	font-weight: 600;
	color: var(--afc-muted);
}

/* ── Details grid (info + services side by side) ── */
.afc-details-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
	margin-bottom: 16px;
}

@media (min-width: 900px) {
	.afc-details-grid { grid-template-columns: 5fr 6fr; }
}

@media (max-width: 640px) {
	.afc-details-grid { grid-template-columns: 1fr; }
}

/* ── Section card ── */
.afc-section {
	background: #fff;
	border: 1px solid var(--afc-border);
	border-radius: var(--afc-radius);
	padding: 22px 24px;
	box-shadow: var(--afc-shadow);
}

.afc-story { margin-bottom: 0; }

.afc-section-title {
	display: flex;
	align-items: center;
	gap: 8px;
	font-family: var(--afc-font);
	font-size: 14px;
	font-weight: 700;
	color: var(--afc-heading);
	text-transform: uppercase;
	letter-spacing: .6px;
	margin: 0 0 18px;
	padding-bottom: 12px;
	border-bottom: 2px solid var(--afc-accent);
}

.afc-section-title svg { color: var(--afc-accent); flex-shrink: 0; }

/* ── Info list ── */
.afc-info-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.afc-info-item {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.afc-info-label {
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: .5px;
	color: var(--afc-muted);
}

.afc-info-value {
	font-size: 14px;
	font-weight: 600;
	color: var(--afc-heading);
}

/* ── Services ── */
.afc-services {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.afc-svc {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 10px 12px;
	border-radius: 8px;
	font-size: 13px;
	font-weight: 600;
}

.afc-svc--done {
	background: rgba(252, 121, 26, .06);
	color: var(--afc-heading);
}

.afc-svc--pending {
	background: var(--afc-bg-light);
	color: #bbb;
}

.afc-svc-icon {
	width: 22px;
	height: 22px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	margin-top: 1px;
}

.afc-svc--done .afc-svc-icon  { background: var(--afc-accent); color: #fff; }
.afc-svc--pending .afc-svc-icon { background: #ddd; color: #fff; }

.afc-svc-body { display: flex; flex-direction: column; gap: 2px; }

.afc-svc--pending .afc-svc-label { text-decoration: line-through; }

.afc-svc-notes {
	font-size: 12px;
	font-weight: 400;
	color: var(--afc-muted);
}

/* ── Story ── */
.afc-story-body {
	font-size: 15px;
	line-height: 1.9;
	color: var(--afc-text);
}

.afc-story-body p { margin: 0 0 1em; }
.afc-story-body p:last-child { margin-bottom: 0; }
