/* =========================================================
   PMPro Membership Black Card
   Real classes confirmed from the live site's rendered HTML:
   .pmpro_card_content
   .pmpro_membership_card-left / -right
   .pmpro_membership_card_field
   .pmpro_membership_card_field-qr_code
   .pmpro_membership_card_field-display_name
   .pmpro_membership_card_field-membership_startdate
   .pmpro_membership_card_field-membership_name
   .pmpro_membership_card_field_label / _data

   BOX MODEL, FINAL: literal fixed pixel width/height on .pmpro-bc-face
   (computed in includes/card-faces.php), no aspect-ratio, no
   padding-bottom percentage trick. Both of those techniques conflicted
   with this stylesheet's own box-sizing: border-box rule below (padding-
   bottom needs content-box sizing; border-box collapses it), which was
   the actual cause of the logo rendering outside the card and downloaded
   images coming out far too tall. Literal px width/height has no such
   ambiguity — border-box is fine (actually preferable) with them.

   Front and back get the EXACT same width/height (see card-faces.php) —
   this guarantees they always match physically for double-sided printing.

   IMPORTANT: nothing in this file targets the add-on's own print/PDF
   mechanism. If you see more than one card size when printing, control
   that from Memberships > Settings (the add-on's own print-size options).
   ========================================================= */

/* ---------- Overall wrapper ---------- */

.pmpro-bc-wrapper {
	display: flex !important;
	flex-direction: column !important;
	align-items: center !important;
	gap: 14px !important;
	width: 100% !important;
	box-sizing: border-box !important;
}

.pmpro-bc-wrapper * {
	box-sizing: border-box !important;
}

/* Mobile default: front on top, back below (single column) */
.pmpro-bc-faces {
	display: flex !important;
	flex-direction: column !important;
	align-items: center !important;
	gap: 20px !important;
	width: 100% !important;
}

/* Desktop: front and back side by side in the same row */
@media (min-width: 720px) {
	.pmpro-bc-faces {
		flex-direction: row !important;
		align-items: flex-start !important;
		justify-content: center !important;
		flex-wrap: wrap !important;
	}
}

/* ---------- Shared face box: literal fixed pixel dimensions ---------- */

.pmpro-bc-face {
	position: relative !important;
	display: block !important;
	width: var( --pmpro-bc-width, 400px ) !important;
	height: var( --pmpro-bc-height, 252px ) !important;
	max-width: 100% !important;
	margin: 0 !important;
	padding: 0 !important;
	border-radius: var( --pmpro-bc-radius, 20px ) !important;
	overflow: hidden !important;
	box-shadow: 0 20px 45px rgba(0, 0, 0, 0.45) !important;
	background: #000000 !important; /* solid black fallback so any transparent/uncovered area of the front image never shows the page's white background through */
	border: none !important;
	flex: 0 0 auto !important;
}

/* On very narrow screens, let the box shrink proportionally rather than
   overflow the viewport. This uses aspect-ratio ONLY as a non-critical
   enhancement here (not the primary sizing mechanism), so even if a
   browser ignores it, the card just stays at its fixed pixel size and
   may need horizontal scroll — it will not distort. */
@media (max-width: 460px) {
	.pmpro-bc-face {
		width: 100% !important;
		max-width: var( --pmpro-bc-width, 400px ) !important;
		aspect-ratio: var( --pmpro-bc-width, 400) / var( --pmpro-bc-height, 252 );
		height: auto !important;
	}
}

/* Front face: just your uploaded artwork, no data */
.pmpro-bc-front img {
	display: block !important;
	width: 100% !important;
	height: 100% !important;
	object-fit: cover !important;
	margin: 0 !important;
}

/* ---------- Back face: the real, dynamic card ---------- */

/* Neutralize any wrapper markup/styles the add-on renders around
   .pmpro_card_content (e.g. a default white background or border),
   without guessing its exact class name. This only affects background/
   shadow/border cosmetics — it never sets display, so it can't hide any
   markup the add-on needs for print. */
.pmpro-bc-back,
.pmpro-bc-back [class*="pmpro_membership_card"]:not(.pmpro_card_content):not([class*="_field"]) {
	background: transparent !important;
	box-shadow: none !important;
	border: none !important;
	margin-top: -18px;
}

.pmpro-bc-back .pmpro_card_content {
	position: relative !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	gap: 22px !important;
	width: 100% !important;
	height: 100% !important;
	padding: 30px 26px !important;
	background: #000000 !important; /* plain black, no pattern, no colored border */
	color: #f2f2f2 !important;
	font-family: "Helvetica Neue", Arial, sans-serif !important;
	border: none !important;
	overflow: hidden !important;
}

/* The add-on's "Print or Save as PDF" button sits in normal document flow
   BEFORE the card content by default — inside our fixed-height box with
   overflow:hidden, that pushed the actual card content down and clipped
   it, and also broke the front/back alignment. Taking it out of flow
   (absolute, top-right corner) fixes both at once, and it gets the same
   discreet treatment as the other links since it's a <button>, not an
   <a>, so the generic link-dimming rule never reached it. */
.pmpro-bc-back .pmpro_membership_card-print-button {
	position: absolute !important;
	top: 6px !important;
	right: 8px !important;
	margin: 0 !important;
	z-index: 6 !important;
}

.pmpro-bc-back .pmpro_membership_card-print-button .pmpro_btn-print {
	display: inline-flex !important;
	align-items: center !important;
	gap: 4px !important;
	padding: 180px 5px !important;
	font-size: 8px !important;
	letter-spacing: 0.2px !important;
	color: #9a9a9a !important;
	--background: rgba( 255, 255, 255, 0.06 ) !important;
	border: none !important;
	border-radius: 999px !important;
	opacity: 0.75 !important;
	cursor: pointer !important;
}

.pmpro-bc-back .pmpro_membership_card-print-button .pmpro_btn-print:hover {
	opacity: 1 !important;
}

.pmpro-bc-back .pmpro_membership_card-print-button .pmpro_btn-print svg {
	width: 10px !important;
	height: 10px !important;
}

/* Left column: QR code */
.pmpro-bc-back .pmpro_membership_card-left {
	flex: 0 0 auto !important;
	padding-right: 20px !important;
	border-right: 1px solid rgba(255, 255, 255, 0.12) !important;
}

.pmpro-bc-back .pmpro_membership_card_field-qr_code {
	text-align: center !important;
}

.pmpro-bc-back .pmpro_membership_card_field-qr_code::before {
	content: "SCAN TO VERIFY";
	display: block;
	font-size: 9px;
	letter-spacing: 1.2px;
	color: #a8a8a8;
	margin-bottom: 8px;
}

.pmpro-bc-back .pmpro_membership_card_field-qr_code img {
	display: block !important;
	background: #ffffff !important;
	padding: 7px !important;
	border-radius: 10px !important;
	width: 96px !important;
	height: 96px !important;
	max-width: 96px !important;
	max-height: 96px !important;
	object-fit: contain !important;
	box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4) !important;
}

/* Right column: member details */
.pmpro-bc-back .pmpro_membership_card-right {
	flex: 1 1 auto !important;
}

.pmpro-bc-back .pmpro_membership_card_field-display_name h2 {
	margin: 0 0 14px !important;
	padding: 0 !important;
	font-family: "Helvetica Neue", Arial, sans-serif !important;
	font-size: 12px !important;
	font-weight: 700 !important;
	letter-spacing: 0.3px !important;
	text-transform: none !important;
	color: #f1592a !important;
}

.pmpro-bc-back .pmpro_membership_card_field {
	margin-bottom: 10px !important;
}

.pmpro-bc-back .pmpro_membership_card_field_label {
	display: block !important;
	font-size: 9.5px !important;
	letter-spacing: 1px !important;
	text-transform: uppercase !important;
	color: #a8a8a8 !important;
	margin-bottom: 2px !important;
}

.pmpro-bc-back .pmpro_membership_card_field_data {
	display: block !important;
	font-size: 13px !important;
	color: #f2f2f2 !important;
}

/* Hide the "Level" label — the level name/expiration text still shows,
   just without that word in front of it. */
.pmpro-bc-back .pmpro_membership_card_field-membership_name .pmpro_membership_card_field_label {
	display: none !important;
}

/* "Expires ..." text color */
.pmpro-bc-back .pmpro_membership_card_field-membership_name .pmpro_membership_card_field_data em {
	display: block !important;
	margin-top: 2px !important;
	font-style: normal !important;
	font-size: 11px !important;
	color: #be4760 !important;
}

/* Never show an avatar on this design, even if a shortcode elsewhere includes it */
.pmpro-bc-back img.avatar,
.pmpro-bc-back .avatar {
	display: none !important;
}

/* Company logo — placed in NORMAL DOCUMENT FLOW below the QR code by
   js/black-card.js (placeLogoBelowQR), not absolutely positioned. This is
   what makes it show up reliably on screen, in "Print or Save as PDF",
   and in "Download as Image" alike, regardless of the site's theme. */
.pmpro-bc-back .pmpro_membership_card-left img.pmpro-bc-logo {
	display: block !important;
	margin: 10px auto 0 !important;
	height: var( --pmpro-bc-logo-height, 22px ) !important;
	width: auto !important;
	max-width: 100% !important;
	object-fit: contain !important;
	filter: drop-shadow( 0 1px 2px rgba( 0, 0, 0, 0.5 ) ) !important;
}

/* ---------- Discreet links generated BY THE ADD-ON ITSELF
   ("Print or Save as PDF" and "View Your Membership Account") ---------- */

.pmpro-bc-wrapper a {
	display: inline-block !important;
	margin-top: 4px !important;
	font-family: "Helvetica Neue", Arial, sans-serif !important;
	font-size: 11px !important;
	letter-spacing: 0.3px !important;
	color: #8a8a8a !important;
	text-decoration: underline !important;
	text-transform: none !important;
	opacity: 0.75 !important;
	background: transparent !important;
	border: none !important;
	box-shadow: none !important;
}

.pmpro-bc-wrapper a:hover {
	opacity: 1 !important;
	color: #b9a06a !important;
}

/* ---------- "Download as Image" / "Share" buttons ---------- */

.pmpro-bc-actions {
	display: flex !important;
	gap: 10px !important;
	flex-wrap: wrap !important;
	justify-content: center !important;
}

.pmpro-bc-action-button {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	padding: 9px 20px !important;
	font-family: "Helvetica Neue", Arial, sans-serif !important;
	font-size: 12.5px !important;
	font-weight: 600 !important;
	letter-spacing: 0.3px !important;
	color: #ffffff !important;
	background: #1a1a1a !important;
	border: 1px solid rgba(255, 255, 255, 0.2) !important;
	border-radius: 999px !important;
	cursor: pointer !important;
	box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25) !important;
	transition: opacity 0.15s ease !important;
}

.pmpro-bc-action-button:hover {
	opacity: 0.85 !important;
}

.pmpro-bc-action-button:disabled {
	opacity: 0.5 !important;
	cursor: default !important;
}

.pmpro-bc-action-button.pmpro-bc-whatsapp {
	background: #25d366 !important;
	border-color: rgba(0, 0, 0, 0.1) !important;
	color: #06210f !important;
}

.pmpro-bc-action-button.pmpro-bc-facebook {
	background: #1877f2 !important;
	border-color: rgba(0, 0, 0, 0.1) !important;
	color: #ffffff !important;
}

/* ---------- Print ---------- */

@media print {
	.pmpro-bc-face {
		box-shadow: none !important;
	}
	.pmpro-bc-back .pmpro_card_content {
		-webkit-print-color-adjust: exact !important;
		print-color-adjust: exact !important;
	}
	.pmpro-bc-back .pmpro_membership_card-print-button {
		display: none !important;
	}
	.pmpro-bc-actions {
		display: none !important;
	}
}

/* =========================================================
   Public verification page [pmpro_verify_card]
   ========================================================= */

.pmpro-bc-verification {
	max-width: 380px;
	margin: 40px auto;
	padding: 30px;
	border-radius: 14px;
	text-align: center;
	font-family: "Helvetica Neue", Arial, sans-serif;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.pmpro-bc-verification .pmpro-bc-icon {
	font-size: 40px;
	margin-bottom: 10px;
}

.pmpro-bc-verification h3 {
	margin: 0 0 10px;
	font-size: 20px;
}

.pmpro-bc-valid {
	background: #eafaf1;
	border: 1px solid #34c977;
	color: #14532d;
}

.pmpro-bc-invalid {
	background: #fdecec;
	border: 1px solid #e5484d;
	color: #7a1114;
}

.pmpro-bc-neutral {
	background: #f4f4f4;
	border: 1px solid #ddd;
	color: #444;
}

.pmpro-bc-name {
	font-weight: 700;
	font-size: 16px;
	margin-top: 6px;
}
