/* ==========================================================================
   WINNERA -- GUILDS PAGE REDESIGN V1 (2026-08-21)
   --------------------------------------------------------------------------
   Loaded only when PAGE === 'guilds' (see index.php), same isolation
   pattern as 10-store-preview.css / 12-design-lab.css / 13-cockpit-preview.css.
   Every rule below is scoped under .wn-guilds so this file cannot affect
   any other route even while it is loaded here. Pairs with the new
   templates/winnera/views/guilds.list.html.twig, which replaces the raw
   legacy MyAAC TableShadowContainer markup system/templates/guilds.list.html.twig
   used before this pass.
   ========================================================================== */

.wn-guilds__intro {
	margin: 0 0 var(--wn-space-5);
	max-width: 62ch;
	color: var(--wn-text-secondary);
	font-size: var(--wn-text-body);
	line-height: 1.6;
}

/* ---- Directory head: title + primary action share one row -------------- */

.wn-guilds__directory .wn-module__head {
	flex-wrap: wrap;
	row-gap: var(--wn-space-2);
}

/* Deliberately NOT .wn-module__title -- that class sits inside index.php's
   outer .wn-content wrapper, where the sitewide .wn-content h2 { font-size:
   var(--wn-text-h3) } fallback (06-legacy.css, shared by every arbitrary
   legacy page) outranks .wn-module__title's own font-size on specificity
   alone (0,1,1 beats 0,1,0), inflating this exact heading to ~28px with no
   room to breathe in a compact module head -- confirmed via real Chromium
   measurement at 900/480px, the literal cause of the reported title
   truncation. This selector reproduces .wn-module__title's other
   properties (uppercase, gold, tracking) but pairs two classes so its own
   font-size wins outright (0,2,0), and drops nowrap/ellipsis for a
   deliberate wrap instead of ever clipping. */
.wn-content .wn-guilds__directory-title {
	margin: 0;
	flex: 1 1 auto;
	min-width: 0;
	font-family: var(--wn-font-body);
	font-size: var(--wn-text-label);
	font-weight: 700;
	letter-spacing: var(--wn-track-label);
	text-transform: uppercase;
	color: var(--wn-gold);
	white-space: normal;
	overflow-wrap: break-word;
}

@media (max-width: 480px) {
	.wn-content .wn-guilds__directory-title { letter-spacing: 0.12em; }
}

.wn-guilds__header-cta { margin-left: auto; flex: none; }

/* ---- Guild list ---------------------------------------------------------- */

.wn-guild-list { list-style: none; margin: 0; padding: 0; }

.wn-guild-row {
	display: flex;
	align-items: center;
	gap: var(--wn-space-4);
	padding: var(--wn-space-3) var(--wn-module-pad);
	border-bottom: 1px solid var(--wn-border-hairline);
	border-left: 2px solid transparent;
	transition: background-color var(--wn-dur) var(--wn-ease), border-left-color var(--wn-dur) var(--wn-ease);
}

.wn-guild-row:last-child { border-bottom: 0; }

.wn-guild-row:hover {
	background: rgba(212, 175, 55, 0.045);
	border-left-color: var(--wn-gold);
}

.wn-guild-row__crest {
	flex: none;
	width: 48px; height: 48px;
	border-radius: var(--wn-radius);
	border: 1px solid var(--wn-border-iron);
	background: var(--wn-surface-sunken);
	object-fit: contain;
}

.wn-guild-row__body {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 0.2rem;
}

.wn-guild-row__name {
	font-family: var(--wn-font-display);
	font-size: 1.05rem;
	font-weight: 700;
	color: var(--wn-bone);
	letter-spacing: 0.01em;
}

.wn-guild-row__desc {
	font-size: var(--wn-text-tiny);
	color: var(--wn-text-muted);
	line-height: 1.5;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.wn-guild-row__actions {
	flex: none;
	display: flex;
	align-items: center;
	gap: var(--wn-space-3);
}

.wn-guild-row__admin {
	font-size: var(--wn-text-tiny);
	color: var(--wn-danger);
	white-space: nowrap;
	opacity: 0.85;
}
.wn-guild-row__admin:hover { opacity: 1; text-decoration: underline; }

@media (max-width: 560px) {
	.wn-guild-row { flex-wrap: wrap; }
	.wn-guild-row__actions { margin-left: calc(48px + var(--wn-space-4)); }
}

/* ---- Empty state ----------------------------------------------------------
   Suggested visual hierarchy from spec: small crest motif, headline,
   two supporting lines, one primary CTA. Built entirely from CSS (no new
   image asset) so it can never regress into a broken-image placeholder. */

.wn-guilds__empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	padding: var(--wn-space-8) var(--wn-space-5);
	gap: var(--wn-space-2);
}

.wn-guilds__crest {
	--wn-guilds-crest-size: 56px;
	width: var(--wn-guilds-crest-size);
	height: var(--wn-guilds-crest-size);
	margin-bottom: var(--wn-space-3);
	position: relative;
	display: block;
	border: 1px solid var(--wn-gold);
	transform: rotate(45deg);
	opacity: 0.85;
}
.wn-guilds__crest::before {
	content: "";
	position: absolute;
	inset: 8px;
	border: 1px solid rgba(212, 175, 55, 0.4);
}
.wn-guilds__crest::after {
	content: "";
	position: absolute;
	inset: 0;
	margin: auto;
	width: 6px; height: 6px;
	background: var(--wn-gold);
	box-shadow: 0 0 10px rgba(212, 175, 55, 0.6);
}

.wn-content .wn-guilds__empty-title {
	margin: 0;
	font-family: var(--wn-font-display);
	font-size: var(--wn-text-h3);
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--wn-bone);
}

.wn-guilds__empty-text {
	margin: 0;
	max-width: 46ch;
	color: var(--wn-text-secondary);
	font-size: var(--wn-text-body);
	line-height: 1.6;
}
.wn-guilds__empty-text--secondary { color: var(--wn-text-muted); font-size: var(--wn-text-label); }

.wn-guilds__empty-cta { margin-top: var(--wn-space-4); }

.wn-guilds__empty-note {
	margin: var(--wn-space-2) 0 0;
	font-size: var(--wn-text-tiny);
	color: var(--wn-text-muted);
}

/* ---- Troubleshooting: quiet, collapsed, never competes with the primary
   action above it. Native <details>/<summary> -- keyboard accessible and
   requires no JS. ------------------------------------------------------- */

.wn-guilds__troubleshoot {
	margin-top: var(--wn-space-5);
	padding-top: var(--wn-space-4);
	border-top: 1px solid var(--wn-border-hairline);
}

.wn-guilds__troubleshoot summary {
	cursor: pointer;
	font-size: var(--wn-text-label);
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--wn-text-muted);
	transition: color var(--wn-dur) var(--wn-ease);
}
.wn-guilds__troubleshoot summary:hover,
.wn-guilds__troubleshoot[open] summary { color: var(--wn-text-secondary); }

.wn-guilds__troubleshoot-text {
	margin: var(--wn-space-3) 0;
	max-width: 62ch;
	color: var(--wn-text-muted);
	font-size: var(--wn-text-tiny);
	line-height: 1.6;
}

.wn-guilds__troubleshoot-links {
	display: flex;
	flex-wrap: wrap;
	gap: var(--wn-space-2) var(--wn-space-5);
}
.wn-guilds__troubleshoot-links a {
	font-size: var(--wn-text-tiny);
	color: var(--wn-text-gold);
}
.wn-guilds__troubleshoot-links a:hover { color: var(--wn-bone); text-decoration: underline; }

/* SECURITY (Cleanup Players Security Hardening, 2026-08-21): cleanup_players
   is now a real <form method="post">, not a plain <a>, so the app's CSRF
   protection actually applies to it -- see the same-named form in
   guilds.list.html.twig. .wn-guilds__troubleshoot-link makes the submit
   button underneath look and behave exactly like the plain text link it
   replaces (no box, no button chrome), so this stays quiet/secondary and
   is not a new CTA. */
.wn-guilds__troubleshoot-form { display: contents; }
.wn-guilds__troubleshoot-link {
	appearance: none;
	background: none;
	border: 0;
	padding: 0;
	margin: 0;
	font: inherit;
	cursor: pointer;
	font-size: var(--wn-text-tiny);
	color: var(--wn-text-gold);
}
.wn-guilds__troubleshoot-link:hover { color: var(--wn-bone); text-decoration: underline; }

/* Administrator-only cleanup_guilds action -- shown only when isAdmin is
   true (see guilds.list.html.twig); kept visually quiet, not a second
   primary CTA, consistent with the rest of this troubleshooting section. */
.wn-guilds__troubleshoot-text--admin {
	margin-top: var(--wn-space-4);
	padding-top: var(--wn-space-3);
	border-top: 1px solid var(--wn-border-hairline);
	color: var(--wn-text-muted);
}
.wn-guilds__troubleshoot-admin { margin-top: var(--wn-space-2); }
