/* Shafazin Club — stable full-bleed directory (flex + auto-fill, no narrow grid traps) */

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

html:has(body.shf-club-shell),
body.shf-club-shell {
	margin: 0;
	padding: 0;
	min-height: 100%;
	background: #f3f5f2;
}

body.shf-club-shell {
	overflow-x: hidden;
}

body.shf-club-directory-page .site-header,
body.shf-club-directory-page .shf-header,
body.shf-club-directory-page .site-footer,
body.shf-club-directory-page .shf-footer,
body.shf-club-directory-page .shf-player-bar,
body.shf-club-directory-page .shf-page-head {
	display: none !important;
}

/* When still embedded in theme page.php (fallback) */
body.shf-club-directory-page:not(.shf-club-shell) .shf-container,
body.shf-club-directory-page:not(.shf-club-shell) .shf-container--narrow,
body.shf-club-directory-page:not(.shf-club-shell) .shf-prose,
body.shf-club-directory-page:not(.shf-club-shell) .shf-article,
body.shf-club-directory-page:not(.shf-club-shell) .site-main,
body.shf-club-directory-page:not(.shf-club-shell) #main,
body.shf-club-directory-page:not(.shf-club-shell) .entry-content {
	width: 100% !important;
	max-width: none !important;
	margin: 0 !important;
	padding: 0 !important;
}

body.shf-club-directory-page:not(.shf-club-shell) .entry-header,
body.shf-club-directory-page:not(.shf-club-shell) .page-header,
body.shf-club-directory-page:not(.shf-club-shell) .entry-title,
body.shf-club-directory-page:not(.shf-club-shell) .shf-page-head {
	display: none !important;
}

.shf-club-shell__main {
	min-height: 100vh;
	margin: 0;
	padding: 0;
}

/* ——— App shell: named areas (immune to RTL column flip) ——— */
.shf-club-app {
	--club-bg: #f0f3f0;
	--club-surface: #ffffff;
	--club-ink: #1c241c;
	--club-muted: #667066;
	--club-line: rgba(28, 36, 28, 0.09);
	--club-primary: #3d6b4f;
	--club-primary-soft: #e8f1eb;
	--club-primary-deep: #2a4a37;
	--club-good: #2f9e6b;
	--club-mid: #c4841f;
	--club-low: #c45c4a;
	--club-radius: 1rem;
	--club-shadow: 0 8px 24px rgba(28, 36, 28, 0.06);
	--club-sidebar: 15.5rem;
	--club-font: "Vazirmatn", "Segoe UI", Tahoma, sans-serif;
	--club-card-min: 17.5rem;

	display: grid;
	/* LTR shell geometry so named areas stay put; content is RTL below */
	direction: ltr;
	grid-template-columns: minmax(0, 1fr) var(--club-sidebar);
	grid-template-areas: "main side";
	width: 100%;
	min-height: 100vh;
	margin: 0;
	padding: 0;
	background: var(--club-bg);
	color: var(--club-ink);
	font-family: var(--club-font);
	line-height: 1.5;
	isolation: isolate;
}

/* Sidebar pinned to the physical right */
.shf-club-sidebar {
	grid-area: side;
	direction: rtl;
	background: var(--club-surface);
	border-left: 1px solid var(--club-line);
	padding: 1.35rem 0.9rem 1.1rem;
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	position: sticky;
	top: 0;
	align-self: start;
	height: 100vh;
	overflow-y: auto;
	z-index: 2;
	min-width: 0;
}

.shf-club-sidebar__brand {
	font-size: 1.3rem;
	font-weight: 800;
	color: var(--club-primary);
	text-decoration: none;
	padding: 0.2rem 0.55rem 1rem;
	letter-spacing: -0.02em;
}

.shf-club-sidebar__brand span {
	color: var(--club-primary-deep);
}

.shf-club-sidebar__label {
	margin: 0.75rem 0.55rem 0.3rem;
	font-size: 0.7rem;
	font-weight: 600;
	color: var(--club-muted);
}

.shf-club-sidebar__nav {
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
}

.shf-club-sidebar__nav a,
.shf-club-sidebar__logout {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	padding: 0.65rem 0.7rem;
	border-radius: 0.8rem;
	color: var(--club-muted);
	text-decoration: none;
	font-size: 0.9rem;
	font-weight: 500;
	transition: background 0.15s ease, color 0.15s ease;
}

.shf-club-sidebar__nav a:hover,
.shf-club-sidebar__logout:hover {
	background: var(--club-primary-soft);
	color: var(--club-primary-deep);
}

.shf-club-sidebar__nav a.is-active {
	background: var(--club-primary);
	color: #fff;
}

.shf-club-sidebar__logout {
	margin-top: auto;
	border: 0;
	background: transparent;
	cursor: pointer;
	width: 100%;
	font: inherit;
	text-align: start;
}

.shf-club-ico {
	display: inline-flex;
	width: 1.15rem;
	height: 1.15rem;
	flex-shrink: 0;
}

/* Main fills remaining width on the left */
.shf-club-main {
	grid-area: main;
	direction: rtl;
	min-width: 0;
	width: 100%;
	padding: 1.35rem clamp(1rem, 2.5vw, 2rem) 2.25rem;
	overflow-x: hidden;
}

.shf-club-top {
	display: flex;
	flex-direction: row;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 1.15rem;
}

.shf-club-top__hello {
	margin: 0;
	font-size: clamp(1.35rem, 2.2vw, 1.75rem);
	font-weight: 800;
	letter-spacing: -0.02em;
	color: var(--club-ink);
	line-height: 1.25;
}

.shf-club-top__lead {
	margin: 0.35rem 0 0;
	color: var(--club-muted);
	font-size: 0.92rem;
	max-width: 36rem;
}

.shf-club-top__actions {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	flex-shrink: 0;
}

.shf-club-bell {
	position: relative;
	width: 2.4rem;
	height: 2.4rem;
	border-radius: 999px;
	border: 1px solid var(--club-line);
	background: var(--club-surface);
	color: var(--club-ink);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
}

.shf-club-bell__dot {
	position: absolute;
	top: 0.4rem;
	inset-inline-start: 0.45rem;
	width: 0.4rem;
	height: 0.4rem;
	border-radius: 999px;
	background: var(--club-low);
	box-shadow: 0 0 0 2px #fff;
}

.shf-club-top__avatar {
	width: 2.4rem;
	height: 2.4rem;
	border-radius: 999px;
	object-fit: cover;
	border: 2px solid #fff;
	box-shadow: 0 0 0 1px var(--club-line);
}

.shf-club-top__avatar.is-guest {
	background: linear-gradient(145deg, var(--club-primary-soft), #d5e4da);
	display: inline-block;
}

/* Filters: horizontal flex, wraps cleanly */
.shf-club-filters {
	margin-bottom: 1.35rem;
}

.shf-club-filters__bar {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 0.75rem 1rem;
	background: var(--club-surface);
	border: 1px solid var(--club-line);
	border-radius: var(--club-radius);
	padding: 0.9rem 1rem;
	box-shadow: var(--club-shadow);
}

.shf-club-field {
	display: flex;
	flex-direction: column;
	gap: 0.28rem;
	flex: 1 1 8.5rem;
	min-width: 7.5rem;
	max-width: 14rem;
}

.shf-club-field span {
	font-size: 0.7rem;
	font-weight: 600;
	color: var(--club-muted);
}

.shf-club-field select {
	width: 100%;
	border: 0;
	border-radius: 0.45rem;
	background-color: transparent;
	font: inherit;
	font-size: 0.9rem;
	font-weight: 600;
	color: var(--club-ink);
	padding: 0.2rem 0;
	padding-inline-end: 1.1rem;
	appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1.5 6 6l5-4.5' stroke='%23667066' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: left 0.1rem center;
	cursor: pointer;
}

.shf-club-field select:focus {
	outline: 2px solid var(--club-primary-soft);
	outline-offset: 2px;
}

.shf-club-search-btn {
	flex: 0 0 2.85rem;
	width: 2.85rem;
	height: 2.85rem;
	margin-inline-start: auto;
	border: 0;
	border-radius: 0.8rem;
	background: var(--club-primary);
	color: #fff;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: background 0.15s ease;
}

.shf-club-search-btn:hover {
	background: var(--club-primary-deep);
}

.shf-club-list__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 0.95rem;
}

.shf-club-list__head h2 {
	margin: 0;
	font-size: 1.1rem;
	font-weight: 800;
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.shf-club-count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 1.55rem;
	height: 1.55rem;
	padding: 0 0.35rem;
	border-radius: 999px;
	background: var(--club-primary-soft);
	color: var(--club-primary-deep);
	font-size: 0.75rem;
	font-weight: 700;
}

.shf-club-list__all {
	color: var(--club-primary);
	font-weight: 600;
	font-size: 0.88rem;
	text-decoration: none;
	white-space: nowrap;
}

.shf-club-list__all:hover {
	text-decoration: underline;
}

/* Cards: auto-fill — never forces broken fixed columns */
.shf-club-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(var(--club-card-min), 1fr));
	gap: 1rem;
	width: 100%;
	align-items: stretch;
}

.shf-club-card {
	background: var(--club-surface);
	border: 1px solid var(--club-line);
	border-radius: calc(var(--club-radius) + 0.05rem);
	padding: 1.05rem 1.1rem 0.95rem;
	box-shadow: var(--club-shadow);
	display: flex;
	flex-direction: column;
	gap: 0.65rem;
	min-width: 0;
	width: 100%;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.shf-club-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 14px 32px rgba(28, 36, 28, 0.09);
}

.shf-club-card.is-hidden {
	display: none !important;
}

.shf-club-card__top {
	display: flex;
	align-items: center;
	gap: 0.7rem;
	min-width: 0;
}

.shf-club-card__avatar {
	width: 3.1rem;
	height: 3.1rem;
	border-radius: 999px;
	object-fit: cover;
	flex-shrink: 0;
}

.shf-club-card__avatar.is-placeholder {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: var(--club-primary-soft);
	color: var(--club-primary-deep);
	font-weight: 700;
}

.shf-club-card__who {
	min-width: 0;
	flex: 1 1 auto;
}

.shf-club-card__name {
	margin: 0;
	font-size: 0.98rem;
	font-weight: 800;
	line-height: 1.35;
	overflow-wrap: anywhere;
}

.shf-club-card__name a {
	color: inherit;
	text-decoration: none;
}

.shf-club-card__name a:hover {
	color: var(--club-primary);
}

.shf-club-card__role {
	margin: 0.12rem 0 0;
	font-size: 0.8rem;
	color: var(--club-muted);
}

.shf-club-card__meta {
	display: flex;
	align-items: center;
	gap: 0.55rem;
	flex-wrap: wrap;
}

.shf-club-rating {
	display: inline-flex;
	align-items: center;
	gap: 0.2rem;
	padding: 0.18rem 0.5rem;
	border-radius: 999px;
	font-size: 0.75rem;
	font-weight: 700;
}

.shf-club-rating.is-good {
	background: rgba(47, 158, 107, 0.12);
	color: var(--club-good);
}

.shf-club-rating.is-mid {
	background: rgba(196, 132, 31, 0.14);
	color: var(--club-mid);
}

.shf-club-rating.is-low {
	background: rgba(196, 92, 74, 0.14);
	color: var(--club-low);
}

.shf-club-loc {
	display: inline-flex;
	align-items: center;
	gap: 0.22rem;
	font-size: 0.78rem;
	color: var(--club-muted);
}

.shf-club-card__stats {
	margin: 0;
	font-size: 0.82rem;
	color: var(--club-muted);
}

.shf-club-card__stats strong {
	color: var(--club-ink);
	font-weight: 700;
}

.shf-club-tags {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 0.3rem;
}

.shf-club-tags li {
	padding: 0.25rem 0.55rem;
	border-radius: 999px;
	background: #eef1ee;
	color: var(--club-muted);
	font-size: 0.72rem;
	font-weight: 600;
}

.shf-club-tags li.is-more {
	background: var(--club-primary-soft);
	color: var(--club-primary-deep);
}

.shf-club-card__foot {
	margin-top: auto;
	padding-top: 0.7rem;
	border-top: 1px solid var(--club-line);
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.65rem;
	flex-wrap: wrap;
}

.shf-club-price {
	margin: 0;
	font-size: 0.9rem;
	font-weight: 800;
	color: var(--club-ink);
}

.shf-club-status {
	margin: 0.12rem 0 0;
	font-size: 0.75rem;
	font-weight: 600;
}

.shf-club-status.is-online {
	color: var(--club-good);
}

.shf-club-status.is-offline {
	color: var(--club-muted);
}

.shf-club-status.is-mixed {
	color: var(--club-primary);
}

.shf-club-book {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.6rem 0.9rem;
	border-radius: 0.7rem;
	background: var(--club-primary);
	color: #fff !important;
	text-decoration: none !important;
	font-size: 0.82rem;
	font-weight: 700;
	white-space: nowrap;
}

.shf-club-book:hover {
	background: var(--club-primary-deep);
}

.shf-club-empty {
	grid-column: 1 / -1;
	margin: 1rem 0;
	color: var(--club-muted);
	text-align: center;
}

.shf-club-empty.is-hidden,
.shf-club-empty[hidden] {
	display: none !important;
}

/* Join form shortcode */
.shf-club-join {
	background: var(--club-surface, #fff);
	border: 1px solid rgba(28, 36, 28, 0.08);
	border-radius: 1rem;
	padding: 1.25rem;
}

.shf-club-join__title {
	margin: 0 0 0.35rem;
	font-size: 1.1rem;
}

.shf-club-join__lead {
	margin: 0 0 0.85rem;
	color: #667066;
	font-size: 0.9rem;
}

.shf-club-join__form {
	display: grid;
	gap: 0.55rem;
}

.shf-club-join__form input {
	padding: 0.7rem 0.85rem;
	border-radius: 0.65rem;
	border: 1px solid rgba(28, 36, 28, 0.12);
	font: inherit;
}

.shf-club-join__form button {
	padding: 0.75rem 1rem;
	border: 0;
	border-radius: 0.65rem;
	background: #3d6b4f;
	color: #fff;
	font: inherit;
	font-weight: 700;
	cursor: pointer;
}

.shf-club-join__notice.is-ok {
	color: #2f9e6b;
}

.shf-club-join__notice.is-err {
	color: #c45c4a;
}

/* Tablet: keep sidebar, shrink cards */
@media (max-width: 1100px) {
	.shf-club-app {
		--club-card-min: 15.5rem;
		--club-sidebar: 13.75rem;
	}
}

/* Mobile: stack shell */
@media (max-width: 860px) {
	.shf-club-app {
		grid-template-columns: 1fr;
		grid-template-areas:
			"side"
			"main";
		--club-card-min: 100%;
	}

	.shf-club-sidebar {
		position: static;
		height: auto;
		border-left: 0;
		border-bottom: 1px solid var(--club-line);
		padding-bottom: 0.85rem;
	}

	.shf-club-sidebar__nav {
		flex-direction: row;
		flex-wrap: wrap;
	}

	.shf-club-sidebar__nav a {
		flex: 1 1 auto;
	}

	.shf-club-sidebar__logout {
		margin-top: 0.5rem;
		width: auto;
	}

	.shf-club-field {
		flex: 1 1 calc(50% - 0.75rem);
		max-width: none;
	}

	.shf-club-search-btn {
		margin-inline-start: 0;
		width: 100%;
		flex: 1 1 100%;
	}

	.shf-club-grid {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 520px) {
	.shf-club-field {
		flex: 1 1 100%;
	}

	.shf-club-top {
		flex-wrap: wrap;
	}
}

@media (prefers-reduced-motion: reduce) {
	.shf-club-card,
	.shf-club-book,
	.shf-club-search-btn {
		transition: none;
	}
}
