// Styles for the file-based site pages served by nodebb-plugin-westgate-pages
// (/ /news /blog /gallery). Recruitment still carries its own scoped <style>
// block in its template; everything here styles the sow-* class family.
// Values follow DESIGN.md: Cinzel 600 headings with the etch shadow, velvet
// panels, the Gilt Edge rule (gold as edging), and dark-gold-plate primaries.

.sow-page {
	font-family: var(--wg-font-text);
	color: var(--wg-text-soft);
	padding-bottom: var(--wg-space-xl);

	a {
		text-decoration: none;
	}

	h1,
	h2,
	h3 {
		font-family: var(--wg-font-display);
		font-weight: 600;
		color: var(--wg-text);
		text-shadow: 0 1px 0 rgba(0, 0, 0, 0.9), 0 0 10px rgba(104, 32, 76, 0.16);
	}

	p {
		color: var(--wg-text-muted);
		line-height: 1.7;
	}
}

.sow-kicker {
	font-family: var(--wg-font-display);
	font-weight: 600;
	font-size: 0.86rem;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--wg-gold);
}

.sow-page-hero {
	text-align: center;
	padding: var(--wg-space-xl) var(--wg-space-md) var(--wg-space-lg);

	h1 {
		font-size: clamp(2.125rem, 5vw, 3.25rem);
		margin: 12px 0 0;
	}

	p {
		font-weight: 300;
		font-size: 1.125rem;
		max-width: 620px;
		margin: 18px auto 0;
	}
}

.sow-section {
	margin-top: var(--wg-space-xl);
}

.sow-section-header {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: var(--wg-space-sm);
	flex-wrap: wrap;
	margin-bottom: var(--wg-space-md);

	h2 {
		font-size: 1.75rem;
		margin: 0;
	}

	p {
		margin: 6px 0 0;
		font-size: 0.9375rem;
	}

	> a {
		font-family: var(--wg-font-display);
		font-weight: 600;
		font-size: 0.86rem;
		letter-spacing: 0.08em;
		text-transform: uppercase;
		color: var(--wg-gold);
		border-bottom: 1px solid var(--wg-gold-soft);
		padding-bottom: 3px;
	}
}

.sow-card {
	display: block;
	background: var(--wg-velvet-panel);
	border: 1px solid var(--wg-border);
	border-radius: 8px;
	box-shadow: var(--wg-velvet-shadow);
	overflow: hidden;
	transition: border-color 0.25s;

	img,
	video {
		display: block;
		width: 100%;
		object-fit: cover;
	}
}

a.sow-card:hover {
	border-color: var(--wg-gold-soft);
}

.sow-card-body {
	padding: var(--wg-space-md);

	h3 {
		font-size: 1.1875rem;
		margin: 0 0 10px;
	}

	p {
		font-size: 0.9rem;
		margin: 0;
	}
}

.sow-meta {
	display: flex;
	gap: var(--wg-space-2xs);
	flex-wrap: wrap;
	margin-bottom: 12px;
}

.sow-chip {
	font-family: var(--wg-font-code);
	font-size: 0.6875rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--wg-gold);
	background: var(--wg-border-soft);
	border: 1px solid var(--wg-gold-soft);
	border-radius: 4px;
	padding: 3px 9px;
}

.sow-button-row {
	display: flex;
	gap: var(--wg-space-xs);
	flex-wrap: wrap;
	margin-top: var(--wg-space-sm);
}

.sow-button {
	display: inline-block;
	font-family: var(--wg-font-ui);
	font-size: 0.8125rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	font-weight: 600;
	color: #d8cec0;
	background: rgba(194, 163, 90, 0.06);
	padding: 12px 24px;
	border-radius: 6px;
	border: 1px solid rgba(216, 194, 138, 0.28);
	transition: background 0.2s, border-color 0.2s;

	&:hover,
	&:focus {
		color: var(--wg-text);
		background: rgba(194, 163, 90, 0.075);
		border-color: rgba(216, 194, 138, 0.44);
	}

	// Matches the theme's .btn-primary dark gold plate (see _controls.scss).
	&.primary {
		color: #f0e6d8;
		background: linear-gradient(to bottom, #5a4a1a 0%, #473914 100%);
		border-color: #a8893f;
		box-shadow:
			inset 0 1px 0 rgba(255, 255, 255, 0.06),
			0 2px 8px rgba(0, 0, 0, 0.24);

		&:hover,
		&:focus {
			color: #fff4dd;
			background: linear-gradient(to bottom, #6a5720 0%, #53431a 100%);
			border-color: #c2a35a;
		}
	}
}

// News: main list + sidebar
.sow-news-layout {
	display: grid;
	grid-template-columns: 2fr 1fr;
	gap: var(--wg-space-lg);
	align-items: start;
}

.sow-sidebar {
	display: grid;
	gap: var(--wg-space-sm);
}

.sow-list {
	display: grid;
	gap: var(--wg-space-xs);
}

.sow-list-item {
	display: grid;
	grid-template-columns: 90px 1fr;
	gap: var(--wg-space-sm);
	background: var(--wg-velvet-panel);
	border: 1px solid var(--wg-border);
	border-radius: 8px;
	padding: var(--wg-space-sm) var(--wg-space-md);
	transition: border-color 0.25s;

	&:hover {
		border-color: var(--wg-gold-soft);
	}

	h3 {
		font-size: 1.125rem;
		margin: 0 0 8px;
	}

	p {
		font-size: 0.875rem;
		margin: 0;
	}
}

.sow-list-date {
	font-family: var(--wg-font-code);
	font-size: 0.75rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--wg-text-muted);
	padding-top: 4px;
}

.sow-note-panel {
	background: var(--wg-panel-2);
	border: 1px solid var(--wg-border-soft);
	border-radius: 6px;
	padding: var(--wg-space-sm) var(--wg-space-md);

	h3 {
		font-size: 1rem;
		margin: 0 0 8px;
	}

	p {
		font-size: 0.84375rem;
		margin: 0;
	}
}

// Featured block: media card + copy card side by side (blog, gallery)
.sow-feature {
	display: grid;
	grid-template-columns: 3fr 2fr;
	gap: var(--wg-space-md);
	align-items: stretch;

	img,
	video {
		height: 100%;
		min-height: 240px;
	}
}

.sow-feature-copy {
	padding: var(--wg-space-lg) var(--wg-space-md);

	h2 {
		font-size: 1.625rem;
		margin: 0 0 14px;
	}

	p {
		font-size: 0.9375rem;
	}
}

.sow-grid {
	display: grid;
	gap: var(--wg-space-md);

	&.three {
		grid-template-columns: repeat(3, 1fr);
	}

	&.four {
		grid-template-columns: repeat(4, 1fr);
	}
}

.sow-gallery-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: var(--wg-space-md);
}

.sow-gallery-card img {
	aspect-ratio: 16 / 10;
}

.sow-empty {
	color: var(--wg-text-muted);
	font-style: italic;
	padding: var(--wg-space-md) 0;
}

.sow-pagination {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: var(--wg-space-md);
	margin-top: var(--wg-space-lg);

	.sow-pagination-status {
		color: var(--wg-text-muted);
	}
}

// Home: art hero
.sow-home-hero {
	position: relative;
	overflow: hidden;
	border: 1px solid var(--wg-border);
	border-radius: 8px;
	min-height: 420px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: var(--wg-space-xl) var(--wg-space-md);
	margin-top: var(--wg-space-2xs);
	box-shadow: var(--wg-velvet-shadow);

	h1 {
		font-size: clamp(2.5rem, 6vw, 4.25rem);
		line-height: 1.04;
		margin: 12px 0 0;
		text-shadow: 0 4px 40px rgba(0, 0, 0, 0.7);
	}

	p {
		font-weight: 300;
		font-size: 1.1875rem;
		color: var(--wg-text-soft);
		max-width: 620px;
		margin: 18px auto 0;
		text-shadow: 0 2px 16px rgba(0, 0, 0, 0.8);
	}

	.sow-button-row {
		justify-content: center;
		margin-top: var(--wg-space-md);
	}
}

.sow-home-hero-bg {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.sow-home-hero-veil {
	position: absolute;
	inset: 0;
	pointer-events: none;
	background: linear-gradient(180deg, rgba(9, 8, 11, 0.55) 0%, rgba(9, 8, 11, 0.25) 38%, rgba(9, 8, 11, 0.82) 86%, var(--wg-bg) 100%);
}

.sow-home-hero-inner {
	position: relative;
}

// Home: server status strip. Servers are grey ("unknown") until the status
// feed marks them .online / .offline — see the script in home.tpl.
.sow-status-strip {
	margin-top: calc(var(--wg-space-lg) * -1);
	position: relative;
	z-index: 5;
	padding: var(--wg-space-sm) var(--wg-space-md);
	display: flex;
	align-items: center;
	gap: var(--wg-space-md);
	flex-wrap: wrap;
	overflow: visible;
}

.sow-status-sep {
	width: 1px;
	height: 40px;
	background: var(--wg-border);
}

.sow-server {
	display: flex;
	align-items: center;
	gap: var(--wg-space-xs);

	&.online .sow-server-dot {
		background: var(--wg-status-online);
		box-shadow: 0 0 0 4px rgba(127, 184, 106, 0.16);
	}

	&.offline .sow-server-dot {
		background: var(--wg-status-offline);
		border-color: transparent;
	}
}

// Unknown (no feed yet): hollow grey ring, so it reads differently from the
// solid grey offline dot.
.sow-server-dot {
	width: 12px;
	height: 12px;
	border-radius: 50%;
	border: 2px solid var(--wg-text-muted);
	background: transparent;
}

.sow-server-name {
	font-family: var(--wg-font-display);
	font-weight: 600;
	font-size: 1.125rem;
	letter-spacing: 0.05em;
	color: var(--wg-text);
}

.sow-server-players,
.sow-connect-label {
	font-family: var(--wg-font-code);
	font-size: 0.6875rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--wg-text-muted);
	margin-top: 3px;
}

.sow-connect {
	flex: 1;
	min-width: 160px;

	.sow-connect-label {
		color: var(--wg-gold);
		margin: 0 0 4px;
	}
}

.sow-connect-addr {
	font-family: var(--wg-font-code);
	font-size: 0.875rem;
	color: var(--wg-text-soft);
}

// Home: setting pitch prose
.sow-pitch {
	max-width: 760px;
	margin: 0 auto;
	padding: var(--wg-space-xl) var(--wg-space-md) 0;
	text-align: center;

	p {
		font-size: 1.0625rem;
		line-height: 1.9;
		margin: 0 0 var(--wg-space-sm);
	}

	blockquote {
		font-family: var(--wg-font-display);
		font-style: italic;
		font-size: 1.375rem;
		line-height: 1.5;
		color: var(--wg-gold);
		margin: var(--wg-space-lg) auto;
		max-width: 560px;
	}
}

.sow-pitch-lead {
	font-weight: 300;
	font-size: 1.375rem;
	line-height: 1.7;
	color: var(--wg-text-soft);
}

.sow-pitch-sign {
	font-family: var(--wg-font-display);
	font-size: 1.1875rem;
	letter-spacing: 0.04em;
	color: var(--wg-text);
}

// Home: centered section head reusing the page-hero type at section scale
.sow-home-section-head {
	padding-top: 0;

	h1 {
		font-size: 2.125rem;
	}
}

@media (max-width: 900px) {
	.sow-news-layout,
	.sow-feature,
	.sow-grid.three {
		grid-template-columns: 1fr;
	}

	.sow-grid.four {
		grid-template-columns: repeat(2, 1fr);
	}

	.sow-status-strip {
		gap: var(--wg-space-sm);
	}

	.sow-status-sep {
		display: none;
	}

	.sow-gallery-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 580px) {
	.sow-gallery-grid {
		grid-template-columns: 1fr;
	}

	.sow-list-item {
		grid-template-columns: 1fr;
	}
}

// Banners: first post image, or the shared velvet gradient
.sow-banner {
	height: 140px;
	background-size: cover;
	background-position: center;
}

.sow-banner-gradient {
	@include wg-velvet-cover;
}

.sow-list-item .sow-banner {
	grid-column: 1 / -1;
	height: 110px;
	margin: calc(var(--wg-space-sm) * -1) calc(var(--wg-space-md) * -1) 0;
	border-radius: 8px 8px 0 0;
}

// Article page
.sow-article-banner {
	height: clamp(180px, 32vw, 340px);
	background-size: cover;
	background-position: center;
	border: 1px solid var(--wg-border);
	border-radius: 8px;
}

.sow-article {
	padding: var(--wg-space-lg) 0;

	header h1 {
		margin: 0 0 6px;
	}
}

.sow-article-date {
	font-family: var(--wg-font-code);
	font-size: 0.75rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--wg-text-muted);
	margin-bottom: var(--wg-space-md);
}

.sow-article-body {
	padding: var(--wg-space-md);
	color: var(--wg-text-soft);
	font-size: 1.0625rem;
	line-height: 1.7;
	background: var(--wg-ledger-panel);
	border: 1px solid var(--wg-ledger-border);
	border-left-color: rgba(194, 163, 90, 0.32);
	border-radius: 6px;
	box-shadow: var(--wg-ledger-shadow);

	h2 {
		margin: var(--wg-space-xl) 0 var(--wg-space-sm);
	}

	h3 {
		margin: var(--wg-space-lg) 0 var(--wg-space-xs);
	}

	p,
	ul,
	ol,
	blockquote {
		margin-bottom: var(--wg-space-md);
	}

	blockquote {
		padding-left: var(--wg-space-md);
		border-left: 2px solid var(--wg-gold-soft);
		color: var(--wg-text-muted);
	}

	img,
	video {
		display: block;
		max-width: 100%;
		border-radius: 8px;
	}
}

.sow-byline,
.sow-byline-author {
	display: flex;
	align-items: center;
	gap: var(--wg-space-xs);
}

.sow-byline {
	margin-bottom: var(--wg-space-lg);
	color: var(--wg-text-muted);
	font-size: 0.875rem;
}

.sow-byline-author img {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	object-fit: cover;
}

.sow-active-filter {
	display: inline-flex;
	align-items: center;
	gap: var(--wg-space-xs);
	margin-top: var(--wg-space-md);
	padding: 3px 9px;
	color: var(--wg-gold);
	background: var(--wg-border-soft);
	border: 1px solid var(--wg-gold-soft);
	border-radius: 4px;
}

.sow-active-filter a {
	color: inherit;
	font-size: 1.125rem;
	line-height: 1;
}

.sow-article-neighbors,
.sow-pagination {
	display: flex;
	justify-content: space-between;
	gap: var(--wg-space-md);
	margin-top: var(--wg-space-xl);
}

.sow-article-neighbors a {
	display: flex;
	align-items: baseline;
	gap: var(--wg-space-xs);
}

.sow-article-older {
	margin-right: auto;
}

.sow-article-newer {
	justify-content: flex-end;
	margin-left: auto;
	text-align: right;
}

.sow-article-neighbors span {
	font-family: var(--wg-font-code);
	font-size: 0.6875rem;
	text-transform: uppercase;
	color: var(--wg-text-muted);
}

.sow-article-neighbors .sow-article-arrow {
	font-size: 1.5rem;
	line-height: 1;
}

.sow-related {
	margin-top: var(--wg-space-xl);
}

.sow-related-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: var(--wg-space-sm);
}

.sow-related-grid .sow-banner {
	height: 90px;
}

.sow-pagination a {
	display: inline-block;
	font-family: var(--wg-font-ui);
	font-size: 0.8125rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	font-weight: 600;
	color: #d8cec0;
	background: rgba(194, 163, 90, 0.06);
	padding: 12px 24px;
	border: 1px solid rgba(216, 194, 138, 0.28);
	border-radius: 6px;
}

@media (max-width: 700px) {
	.sow-related-grid {
		grid-template-columns: 1fr;
	}

	.sow-article-neighbors {
		flex-direction: column;
	}

	.sow-article-newer {
		align-self: flex-end;
	}
}
