/* CBC Community — front-end styles.
   Tuned to the Craft Beer Crew palette: deep green + golden amber.
   Inherits the active theme's fonts; only layout and accents are set here. */

.cbc-comp,
.cbc-comp-grid {
	--cbc-green: #1c7a33;
	--cbc-green-dark: #14592a;
	--cbc-amber: #efa31d;
	--cbc-amber-dark: #b9790c;
	--cbc-ink: #2c2c2a;
	--cbc-line: rgba(0, 0, 0, 0.12);
	--cbc-radius: 10px;
}

/* ---- Listing grid ---- */
.cbc-comp-grid {
	display: grid;
	grid-template-columns: repeat( auto-fill, minmax( 240px, 1fr ) );
	gap: 18px;
	margin: 1.5em 0;
}

.cbc-comp-card {
	display: flex;
	flex-direction: column;
	border: 1px solid var(--cbc-line);
	border-radius: var(--cbc-radius);
	overflow: hidden;
	text-decoration: none;
	color: var(--cbc-ink);
	background: #fff;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.cbc-comp-card:hover {
	transform: translateY( -2px );
	box-shadow: 0 6px 18px rgba( 0, 0, 0, 0.1 );
}

.cbc-comp-thumb img {
	display: block;
	width: 100%;
	height: 150px;
	object-fit: cover;
}

.cbc-comp-body {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 14px 16px 16px;
}

.cbc-comp-status {
	align-self: flex-start;
	font-size: 11px;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	font-weight: 700;
	padding: 2px 9px;
	border-radius: 999px;
	background: #eef3ec;
	color: var(--cbc-green-dark);
}

.cbc-status-open .cbc-comp-status {
	background: var(--cbc-green);
	color: #fff;
}

.cbc-status-announced .cbc-comp-status {
	background: var(--cbc-amber);
	color: #3a2700;
}

.cbc-comp-title {
	font-size: 18px;
	font-weight: 700;
	line-height: 1.25;
}

.cbc-comp-type {
	font-size: 13px;
	color: #5f5e5a;
}

.cbc-comp-prize {
	font-size: 13px;
	color: var(--cbc-amber-dark);
	font-weight: 600;
}

/* ---- Single competition block ---- */
.cbc-comp {
	margin: 1.75em 0;
	padding: 20px 22px;
	border: 1px solid var(--cbc-line);
	border-left: 4px solid var(--cbc-green);
	border-radius: var(--cbc-radius);
	background: #fafbf9;
}

.cbc-comp .cbc-prize {
	margin: 0 0 0.75em;
	font-size: 15px;
}

.cbc-comp .cbc-prize span {
	font-weight: 700;
	color: var(--cbc-amber-dark);
}

.cbc-help {
	color: #5f5e5a;
	font-size: 14px;
}

.cbc-empty {
	color: #6c6b66;
	font-style: italic;
}

.cbc-winner {
	font-size: 17px;
	background: #fff6e2;
	border: 1px solid var(--cbc-amber);
	border-radius: 8px;
	padding: 10px 14px;
}

.cbc-entered {
	color: var(--cbc-green-dark);
	font-weight: 600;
}

/* ---- Buttons ---- */
.cbc-btn {
	display: inline-block;
	border: 0;
	cursor: pointer;
	font: inherit;
	font-weight: 600;
	padding: 10px 18px;
	border-radius: 8px;
	background: var(--cbc-green);
	color: #fff;
	text-decoration: none;
	transition: background 0.15s ease;
}

.cbc-btn:hover {
	background: var(--cbc-green-dark);
	color: #fff;
}

.cbc-btn:focus-visible {
	outline: 3px solid var(--cbc-amber);
	outline-offset: 2px;
}

.cbc-btn[disabled],
.cbc-btn.is-picked {
	background: var(--cbc-amber);
	color: #3a2700;
	cursor: default;
}

/* ---- Best article nominees ---- */
.cbc-nominees {
	list-style: none;
	margin: 1em 0 0.5em;
	padding: 0;
}

.cbc-nominee {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
	padding: 12px 14px;
	border: 1px solid var(--cbc-line);
	border-radius: 8px;
	margin-bottom: 10px;
	background: #fff;
}

.cbc-nominee.is-picked {
	border-color: var(--cbc-amber);
	background: #fffaf0;
}

.cbc-nominee-title {
	font-weight: 600;
	flex: 1 1 60%;
	text-decoration: none;
	color: var(--cbc-green-dark);
}

.cbc-nominee-title:hover {
	text-decoration: underline;
}

.cbc-nominee-meta {
	font-size: 13px;
	color: #5f5e5a;
	min-width: 64px;
	text-align: right;
}

.cbc-total {
	font-size: 13px;
	color: #6c6b66;
}

.cbc-login a {
	font-weight: 600;
	color: var(--cbc-green-dark);
}

.cbc-flash {
	display: inline-block;
	margin-left: 10px;
	font-size: 13px;
	color: #a32d2d;
}

/* ---- Standalone upvote (Phase 2) ---- */
.cbc-upvote {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	border: 1px solid var(--cbc-green);
	background: #fff;
	color: var(--cbc-green-dark);
	border-radius: 999px;
	padding: 5px 14px;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.cbc-upvote.is-voted {
	background: var(--cbc-green);
	color: #fff;
}

@media ( prefers-reduced-motion: reduce ) {
	.cbc-comp-card,
	.cbc-btn {
		transition: none;
	}
}

/* ---- Hub: live competition + locked history ---- */
.cbc-hub {
	--cbc-green: #1c7a33;
	--cbc-green-dark: #14592a;
	--cbc-amber: #efa31d;
	--cbc-amber-dark: #b9790c;
	--cbc-line: rgba( 0, 0, 0, 0.12 );
}

.cbc-hero {
	position: relative;
	border: 1px solid var(--cbc-line);
	border-top: 5px solid var(--cbc-green);
	border-radius: 12px;
	padding: 22px 24px 6px;
	background: #fff;
	margin: 0 0 2.5em;
}

.cbc-live-badge {
	display: inline-block;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: #fff;
	background: var(--cbc-green);
	padding: 4px 12px;
	border-radius: 999px;
}

.cbc-hero-img {
	margin: 16px 0;
}

.cbc-hero-img img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 10px;
}

.cbc-hero-title {
	margin: 14px 0 6px;
	line-height: 1.2;
}

.cbc-blurb {
	color: #3a3a37;
}

.cbc-history-heading {
	font-size: 22px;
	margin: 0 0 0.8em;
	padding-bottom: 0.35em;
	border-bottom: 2px solid var(--cbc-amber);
}

.cbc-history-list {
	display: grid;
	gap: 18px;
}

.cbc-locked {
	display: flex;
	gap: 18px;
	border: 1px solid var(--cbc-line);
	border-radius: 10px;
	overflow: hidden;
	background: #fbfbf9;
	opacity: 0.96;
}

.cbc-locked-img {
	flex: 0 0 38%;
	max-width: 240px;
}

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

.cbc-locked-body {
	flex: 1 1 auto;
	padding: 16px 18px;
}

.cbc-locked-badge {
	display: inline-block;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: #5f5e5a;
	background: #eceae2;
	padding: 2px 9px;
	border-radius: 999px;
}

.cbc-locked-title {
	margin: 8px 0 6px;
	line-height: 1.25;
}

.cbc-locked .cbc-comp {
	margin: 10px 0 0;
	padding: 0;
	border: 0;
	background: none;
}

.cbc-results .cbc-nominee {
	cursor: default;
}

.cbc-nominee.is-winner {
	border-color: var(--cbc-amber);
	background: #fffaf0;
}

.cbc-win-tag {
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #3a2700;
	background: var(--cbc-amber);
	padding: 2px 8px;
	border-radius: 999px;
	margin-right: 8px;
}

.cbc-link {
	font-weight: 600;
	color: var(--cbc-green-dark);
}

@media ( max-width: 600px ) {
	.cbc-locked {
		flex-direction: column;
	}
	.cbc-locked-img {
		flex-basis: auto;
		max-width: none;
		max-height: 180px;
	}
}

/* ---- Photo competition: gallery + upload ---- */
.cbc-gallery {
	display: grid;
	grid-template-columns: repeat( auto-fill, minmax( 200px, 1fr ) );
	gap: 16px;
	list-style: none;
	margin: 1em 0 0.5em;
	padding: 0;
}

.cbc-gallery .cbc-submission {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 8px;
	padding: 10px;
	margin: 0;
	position: relative;
}

.cbc-submission-img img {
	display: block;
	width: 100%;
	height: 180px;
	object-fit: cover;
	border-radius: 6px;
}

.cbc-submission-caption {
	font-weight: 600;
	color: var(--cbc-ink, #2c2c2a);
	flex: 0 0 auto;
}

.cbc-submission .cbc-nominee-meta {
	text-align: left;
	min-width: 0;
}

.cbc-submission .cbc-win-tag {
	position: absolute;
	top: 16px;
	left: 16px;
	z-index: 1;
}

.cbc-your-entry {
	font-size: 13px;
	font-weight: 600;
	color: #5f5e5a;
	align-self: flex-start;
}

.cbc-photo-form {
	margin: 1.25em 0 0;
	padding: 16px 18px;
	border: 1px dashed var(--cbc-green, #1c7a33);
	border-radius: 10px;
	background: #f6faf4;
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: center;
}

.cbc-photo-form .cbc-help {
	flex: 1 1 100%;
	margin: 0;
}

.cbc-photo-form .cbc-photo-file {
	flex: 1 1 220px;
}

.cbc-photo-form .cbc-photo-caption {
	flex: 1 1 200px;
	padding: 8px 10px;
	border: 1px solid var(--cbc-line, rgba( 0, 0, 0, 0.12 ));
	border-radius: 6px;
	font: inherit;
}

@media ( max-width: 600px ) {
	.cbc-photo-form .cbc-photo-file,
	.cbc-photo-form .cbc-photo-caption,
	.cbc-photo-form .cbc-photo-submit {
		flex-basis: 100%;
	}
}

/* ---- Upvote button (single articles) ---- */
.cbc-upvote-wrap {
	margin: 1.5em 0;
}

.cbc-upvote-icon {
	font-size: 11px;
	line-height: 1;
}

.cbc-upvote-count {
	font-weight: 700;
	margin-left: 2px;
}

/* ---- Leaderboard ---- */
.cbc-leaderboard {
	--cbc-green: #1c7a33;
	--cbc-green-dark: #14592a;
	--cbc-amber: #efa31d;
	--cbc-line: rgba( 0, 0, 0, 0.1 );
	margin: 1.5em 0;
	overflow-x: auto;
}

.cbc-lb-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 15px;
}

.cbc-lb-table th,
.cbc-lb-table td {
	padding: 10px 12px;
	border-bottom: 1px solid var(--cbc-line);
	text-align: left;
}

.cbc-lb-table thead th {
	background: var(--cbc-green);
	color: #fff;
	font-weight: 700;
	border-bottom: 0;
}

.cbc-lb-table thead th:first-child {
	border-top-left-radius: 8px;
}

.cbc-lb-table thead th:last-child {
	border-top-right-radius: 8px;
}

.cbc-lb-num {
	text-align: right;
	font-variant-numeric: tabular-nums;
}

.cbc-lb-rank {
	width: 48px;
	text-align: center;
	font-weight: 700;
	color: var(--cbc-green-dark);
}

.cbc-lb-points {
	font-weight: 700;
	color: var(--cbc-green-dark);
}

.cbc-lb-name a {
	font-weight: 600;
	color: var(--cbc-green-dark);
	text-decoration: none;
}

.cbc-lb-name a:hover {
	text-decoration: underline;
}

.cbc-lb-top .cbc-lb-rank {
	color: var(--cbc-amber);
}

.cbc-lb-me {
	background: #fffaf0;
}

.cbc-lb-me .cbc-lb-name a {
	color: var(--cbc-amber-dark, #b9790c);
}

/* ---- Member stats strip ---- */
.cbc-member-stats {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 16px;
	padding: 12px 16px;
	border: 1px solid var(--cbc-line, rgba( 0, 0, 0, 0.1 ));
	border-left: 4px solid var(--cbc-green, #1c7a33);
	border-radius: 8px;
	background: #fafbf9;
	margin: 1.25em 0;
}

.cbc-ms-rank {
	font-size: 22px;
	font-weight: 800;
	color: var(--cbc-green-dark, #14592a);
}

.cbc-ms-block strong {
	font-size: 18px;
}

/* ---- Front-end competition builder ---- */
.cbc-builder {
	--cbc-green: #1c7a33;
	--cbc-green-dark: #14592a;
	--cbc-amber: #efa31d;
	--cbc-line: rgba( 0, 0, 0, 0.14 );
	max-width: 640px;
	border: 1px solid var(--cbc-line);
	border-top: 4px solid var(--cbc-green);
	border-radius: 12px;
	padding: 22px 24px;
	background: #fff;
	margin: 1.5em 0;
}

.cbc-builder-title {
	margin: 0 0 0.5em;
}

.cbc-builder-running {
	background: #fff6e2;
	border: 1px solid var(--cbc-amber);
	border-radius: 8px;
	padding: 8px 12px;
}

.cbc-builder-field {
	margin: 0 0 16px;
}

.cbc-builder-field label {
	display: block;
	font-weight: 600;
	margin: 0 0 5px;
}

.cbc-builder-field input[type="text"],
.cbc-builder-field input[type="url"],
.cbc-builder-field input[type="date"],
.cbc-builder-field select,
.cbc-builder-field textarea {
	width: 100%;
	padding: 9px 11px;
	border: 1px solid var(--cbc-line);
	border-radius: 7px;
	font: inherit;
	box-sizing: border-box;
}

.cbc-builder-field textarea {
	resize: vertical;
}

.cbc-builder-field .cbc-help {
	display: block;
	margin-top: 4px;
	font-size: 13px;
	color: #5f5e5a;
}

.cbc-b-cond label:not(:first-child) {
	margin-top: 12px;
}

.cbc-builder-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 4px;
}

.cbc-btn-secondary {
	background: #fff;
	color: var(--cbc-green-dark);
	border: 1px solid var(--cbc-green);
}

.cbc-btn-secondary:hover {
	background: #eef3ec;
	color: var(--cbc-green-dark);
}

.cbc-builder-msg {
	margin-top: 14px;
	font-weight: 600;
}

.cbc-builder-msg.cbc-b-ok {
	color: var(--cbc-green-dark);
}

.cbc-builder-msg.cbc-b-ok a {
	margin-left: 4px;
}

.cbc-builder-msg.cbc-b-error {
	color: #a32d2d;
}

/* ---- Competition manager (front-end Admin Panel) ---- */
.cbc-panel {
	--cbc-green: #1c7a33;
	--cbc-green-dark: #14592a;
	--cbc-amber: #efa31d;
	--cbc-line: rgba( 0, 0, 0, 0.14 );
	max-width: 640px;
}

.cbc-manage {
	margin: 1.5em 0;
}

.cbc-mgroup {
	margin: 0 0 18px;
}

.cbc-mgroup-title {
	margin: 0 0 8px;
	font-size: 14px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #5f5e5a;
}

.cbc-mgroup-open {
	color: var(--cbc-green-dark);
}

.cbc-mrow {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 11px 14px;
	border: 1px solid var(--cbc-line);
	border-radius: 9px;
	background: #fff;
	margin: 0 0 8px;
}

.cbc-mrow-title {
	font-weight: 600;
}

.cbc-mrow-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.cbc-mrow-actions .cbc-btn {
	padding: 6px 12px;
	font-size: 14px;
}

.cbc-btn-danger {
	background: #fff;
	color: #a32d2d;
	border: 1px solid #d98a8a;
}

.cbc-btn-danger:hover {
	background: #fbeaea;
	color: #a32d2d;
}

.cbc-b-cancel {
	align-self: center;
	font-size: 14px;
}
