/* The directory is server-rendered before #main (via astra_content_top) so
   search engines see it without running JS. #main's own (empty) content —
   Astra's default "nothing found" markup, since the query is blanked — is
   hidden rather than removed, so no theme hook ordering is load-bearing. */
body.ah-ssr-directory #main {
	display: none;
}

/* astra_content_top fires as a sibling of #primary inside .ast-container,
   which Astra makes display:flex (row, desktop-only) for its sidebar
   layout — turning our hero + directory into competing flex items that get
   squeezed alongside #primary. Forcing column direction unconditionally
   (mobile included, where Astra never sets display:flex to begin with)
   makes every item stack full-width, and lets `order` below control visual
   sequence independent of DOM order at every screen size. */
/* align-items:stretch is the flex default, so column items already fill
   the cross axis — no explicit width needed (and adding one here would
   override .ah-hero's 100vw full-bleed and .ah-directory's negative-margin
   widening, both of which depend on an auto width). */
body.ah-ssr-directory .site-content .ast-container {
	display: flex !important;
	flex-direction: column !important;
}

/* astra_content_top fires BEFORE #primary opens, so our directory ends up
   before #primary in DOM order — but #primary still holds the (visible)
   category title banner, which reads better ahead of the table. */
body.ah-ssr-directory .ah-hero,
body.ah-ssr-directory #primary {
	order: 1;
}
body.ah-ssr-directory .ah-directory {
	order: 2;
}

/* On the front page #primary has nothing left in it (no archive banner,
   and #main is hidden above) — collapse it entirely so it doesn't sit as
   an empty flex item between the hero and the table. */
body.home.ah-ssr-directory #primary {
	display: none;
}

.ah-directory {
	max-width: none;
	margin: 0 -6%;
}

/* Front-page hero: full viewport width, edge to edge, regardless of theme
   container nesting. */
.ah-hero {
	width: 100vw;
	margin-left: calc(-50vw + 50%);
	margin-right: calc(-50vw + 50%);
	margin-bottom: 32px;
	background: var(--ast-global-color-0, #2B0057);
	color: #fff;
	padding: 56px 6vw;
	box-sizing: border-box;
}

/* Left/right padding is overridden inline by directory.js to match
   .ah-filters' exact left edge — the 6vw above is only a fallback before
   that JS measurement runs. */
.ah-hero-inner {
	max-width: 60ch;
}

/* Astra's default blog-layout top spacing above #primary; removed only on
   the front page so the hero sits flush under the header. */
body.home #primary {
	margin-top: 0 !important;
}

.ah-hero h1 {
	margin: 0 0 12px;
	color: #fff;
	font-size: 34px;
	font-weight: 800;
	letter-spacing: -0.01em;
}

.ah-hero p {
	margin: 0;
	color: rgba(255, 255, 255, 0.85);
	font-size: 16px;
	max-width: 60ch;
}

@media (max-width: 640px) {
	.ah-hero h1 {
		font-size: 26px;
	}
}

/* Category archive title banner: widened to match the directory table
   below it, filled with the theme accent color. Applies to every category
   archive (.ast-archive-description only ever appears on those). */
.ast-archive-description {
	max-width: none !important;
	width: auto !important;
	margin: 0 -6% 24px !important;
	background: var(--ast-global-color-0, #2B0057) !important;
	color: #fff !important;
	padding: 40px 48px;
	border-radius: 10px;
	box-sizing: border-box;
}

.ast-archive-description .page-title,
.ast-archive-description h1 {
	color: #fff !important;
}

.ast-archive-description p {
	color: rgba(255, 255, 255, 0.85) !important;
}

@media (max-width: 900px) {
	.ah-directory,
	.ast-archive-description {
		margin-left: 0 !important;
		margin-right: 0 !important;
	}
}

.ah-filters {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 16px;
	margin-bottom: 20px;
	padding: 20px;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
}

.ah-filter-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 200px;
}

.ah-filter-field label {
	font-size: 13px;
	font-weight: 600;
	color: #374151;
}

.ah-filter-field select {
	padding: 10px 12px;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	font-size: 15px;
	background: #fff;
	color: #111827;
}

.ah-filter-field select:focus {
	outline: 2px solid var(--ast-global-color-0, #2B0057);
	outline-offset: 1px;
}

.ah-filter-clear {
	padding: 10px 16px;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	background: #fff;
	color: #374151;
	font-size: 14px;
	cursor: pointer;
	height: 41px;
}

.ah-filter-clear:hover {
	border-color: var(--ast-global-color-0, #2B0057);
	color: var(--ast-global-color-0, #2B0057);
}

.ah-result-count {
	margin: 0 0 16px;
	color: #6b7280;
	font-size: 14px;
}

.ah-table-wrap {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	overflow-x: auto;
}

.ah-table {
	width: 100%;
	border-collapse: collapse;
	table-layout: fixed;
	min-width: 1080px;
}

.ah-table thead th {
	text-align: left;
	font-size: 12.5px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .03em;
	color: #6b7280;
	padding: 14px 18px;
	border-bottom: 1px solid #e5e7eb;
	white-space: nowrap;
}

.ah-table tbody td {
	padding: 16px 18px;
	border-bottom: 1px solid #f1f2f4;
	font-size: 14.5px;
	color: #374151;
	vertical-align: middle;
}

.ah-table tbody tr:last-child td {
	border-bottom: none;
}

.ah-table tbody tr:hover {
	background: #faf9fc;
}

.ah-col-name {
	white-space: normal;
}

.ah-name-cell {
	display: flex;
	align-items: center;
	gap: 12px;
	color: #111827;
	text-decoration: none;
	font-weight: 600;
}

.ah-name-cell:hover {
	color: var(--ast-global-color-0, #2B0057);
}

.ah-avatar {
	position: relative;
	flex: none;
	width: 32px;
	height: 32px;
	border-radius: 8px;
	background: var(--ast-global-color-0, #2B0057);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 14px;
	font-weight: 700;
	overflow: hidden;
}

.ah-avatar img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: contain;
	background: #fff;
	padding: 4px;
	box-sizing: border-box;
}

.ah-table td a:not(.ah-name-cell) {
	color: #e5177f;
	text-decoration: none;
}

.ah-table td a:not(.ah-name-cell):hover {
	color: #c9126e;
	text-decoration: underline;
}

.ah-pill-group {
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
}

.ah-pill {
	display: inline-block;
	padding: 3px 11px;
	border-radius: 999px;
	border: 1px solid var(--ast-global-color-0, #2B0057);
	color: var(--ast-global-color-0, #2B0057);
	font-size: 12.5px;
	font-weight: 600;
	white-space: normal;
	line-height: 1.3;
}

/* Fixed proportions so total table width stays predictable regardless of
   how long individual tag/payment-method text runs — long labels wrap
   within their column instead of stretching the table wider. */
.ah-table th:nth-child(1), .ah-table td:nth-child(1) { width: 14%; }
.ah-table th:nth-child(2), .ah-table td:nth-child(2) { width: 9%; }
.ah-table th:nth-child(3), .ah-table td:nth-child(3) { width: 10%; }
.ah-table th:nth-child(4), .ah-table td:nth-child(4) { width: 9%; }
.ah-table th:nth-child(5), .ah-table td:nth-child(5) { width: 18%; }
.ah-table th:nth-child(6), .ah-table td:nth-child(6) { width: 10%; }
.ah-table th:nth-child(7), .ah-table td:nth-child(7) { width: 22%; }
.ah-table th:nth-child(8), .ah-table td:nth-child(8) { width: 8%; }

.ah-table td, .ah-table th {
	overflow-wrap: break-word;
}

.ah-pill-muted {
	border-color: #d1d5db;
	color: #4b5563;
}

.ah-pill-pink {
	border-color: #f7c9e0;
	color: #e5177f;
}

.ah-pill-more {
	border-style: dashed;
	border-color: #d1d5db;
	color: #9ca3af;
	cursor: default;
}

@media (max-width: 640px) {
	.ah-filter-field {
		min-width: 0;
		flex: 1 1 auto;
	}
}

.ah-empty, .ah-error {
	padding: 40px 20px;
	text-align: center;
	color: #6b7280;
}

.ah-load-more-wrap {
	text-align: center;
	margin-top: 28px;
}

.ah-load-more {
	padding: 12px 28px;
	border-radius: 8px;
	border: none;
	background: var(--ast-global-color-0, #2B0057);
	color: #fff;
	font-size: 15px;
	cursor: pointer;
}

.ah-load-more:hover {
	opacity: 0.9;
}

.ah-skeleton {
	color: #9ca3af;
	text-align: center;
	padding: 30px;
}
