/**
 * Product Highlight Gutenberg Block Styles
 * Star Industries
 */

/* Card Container: 3-tier layout (Header across, 2-column Body, Actions across bottom) */
.star-product-highlight {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	padding: 1rem;
	background-color: #ffffff;
	border: 1px solid #e8eef3;
	margin-top: 2rem;
	margin-bottom: 2rem;
	box-sizing: border-box;
}

/* Legacy 2-column fallback (for posts saved with older HTML until re-saved) */
.star-product-highlight:has(> .star-product-highlight__content) {
	display: grid;
	grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
	gap: 1.75rem;
	align-items: center;
}
.star-product-highlight:has(> .star-product-highlight__content):not(:has(.star-product-highlight__media)):not(:has(.star-product-highlight__media-wrap)) {
	grid-template-columns: 1fr;
}

/* Left Column: Image */
.star-product-highlight__media,
.star-product-highlight__media-wrap {
	margin: 0;
	padding: 0;
	display: flex;
	justify-content: center;
	align-items: center;
	width: 100%;
}

.star-product-highlight__img {
	display: block;
	width: 100%;
	max-width: 100%;
	height: auto;
	object-fit: contain;
}

/* Editor media controls */
.star-product-highlight__media-preview {
	width: 100%;
	text-align: center;
}

.star-product-highlight__upload-btn {
	display: flex !important;
	align-items: center;
	justify-content: center;
	width: 100% !important;
	min-height: 240px;
	border: 2px dashed #cbd5e1 !important;
	border-radius: 0.85rem !important;
	background-color: #f8fafc !important;
	color: #475569 !important;
	font-weight: 600 !important;
	cursor: pointer;
	transition: border-color 0.15s ease, background-color 0.15s ease;
}

.star-product-highlight__upload-btn:hover {
	border-color: #0099ba !important;
	background-color: #f0f9ff !important;
	color: #0099ba !important;
}

.star-product-highlight__media-actions {
	display: flex;
	gap: 0.5rem;
	margin-top: 0.75rem;
	justify-content: center;
}

/* Right Column: Content (Eyebrow, Title, List, Actions) */
.star-product-highlight__content {
	display: flex;
	flex-direction: column;
	justify-content: center;
	width: 100%;
	min-width: 0;
}

/* Eyebrow */
.star-product-highlight__eyebrow {
	margin: 0 0 0.5rem 0 !important;
	padding: 0 !important;
	font-size: 0.8rem !important;
	font-weight: 700 !important;
	letter-spacing: 0.1em !important;
	text-transform: uppercase !important;
	color: #64748b !important;
	line-height: 1.2 !important;
}

.star-product-highlight__eyebrow::after {
	content: "";
	display: block;
	width: 2.75rem;
	height: 3px;
	margin-top: 0.45rem;
	background-color: #0099ba;
	border-radius: 2px;
}

/* Title */
.star-product-highlight__title {
	margin: 0 0 0.5rem 0 !important;
	padding: 0 0 0.75rem 0 !important;
	font-size: clamp(1.4rem, 2vw, 1.75rem) !important;
	font-weight: 800 !important;
	line-height: 1.2 !important;
	color: #1e293b !important;
	border-bottom: 1px solid #eef2f6 !important;
}

/* Header Across: Eyebrow + Title */
.star-product-highlight__header {
	width: 100%;
}

/* Body: Two Columns (Image on Left, List on Right) */
.star-product-highlight__body {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
	gap: 1rem;
	align-items: center;
	width: 100%;
}

/* Fallback if no media element is present in body */
.star-product-highlight__body:not(:has(.star-product-highlight__media)):not(:has(.star-product-highlight__media-wrap)) {
	grid-template-columns: 1fr;
}

.star-product-highlight__list-wrap {
	display: flex;
	flex-direction: column;
	justify-content: center;
	width: 100%;
}

/* Arrow Bullet List */
.star-product-highlight__list,
.star-product-highlight ul,
.editor-styles-wrapper .star-product-highlight__list,
.editor-styles-wrapper .star-product-highlight ul,
.wp-block-star-industries-product-highlight ul,
ul.star-product-highlight__list {
	margin: 0 !important;
	padding: 0 !important;
	list-style: none !important;
	list-style-type: none !important;
}

.star-product-highlight__list li,
.star-product-highlight ul li,
.editor-styles-wrapper .star-product-highlight__list li,
.editor-styles-wrapper .star-product-highlight ul li,
.editor-styles-wrapper ul.star-product-highlight__list li,
.wp-block-star-industries-product-highlight ul li {
	position: relative !important;
	display: block !important;
	padding-left: 1.65rem !important;
	margin-bottom: 0.65rem !important;
	font-size: 0.9rem !important;
	line-height: 1.45 !important;
	color: #334155 !important;
	list-style: none !important;
	list-style-type: none !important;
}

.star-product-highlight__list li::marker,
.star-product-highlight ul li::marker,
.editor-styles-wrapper .star-product-highlight__list li::marker,
.editor-styles-wrapper .star-product-highlight ul li::marker,
.wp-block-star-industries-product-highlight ul li::marker {
	content: none !important;
	display: none !important;
}

.star-product-highlight__list li:last-child,
.star-product-highlight ul li:last-child {
	margin-bottom: 0 !important;
}

/* Arrow icon in brand cyan (Base64 SVG for guaranteed editor & frontend rendering) */
.star-product-highlight__list li::before,
.star-product-highlight ul li::before,
.editor-styles-wrapper .star-product-highlight__list li::before,
.editor-styles-wrapper .star-product-highlight ul li::before,
.editor-styles-wrapper ul.star-product-highlight__list li::before,
.wp-block-star-industries-product-highlight ul li::before {
	content: "" !important;
	--tw-content: "" !important;
	display: block !important;
	position: absolute !important;
	left: 0 !important;
	top: 0.15em !important;
	width: 1.05rem !important;
	height: 1.05rem !important;
	background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjMDA5OWJhIiBzdHJva2Utd2lkdGg9IjIuNzUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCI+PGxpbmUgeDE9IjQiIHkxPSIxMiIgeDI9IjIwIiB5Mj0iMTIiPjwvbGluZT48cG9seWxpbmUgcG9pbnRzPSIxMyA1IDIwIDEyIDEzIDE5Ij48L3BvbHlsaW5lPjwvc3ZnPg==") !important;
	background-repeat: no-repeat !important;
	background-position: left center !important;
	background-size: contain !important;
	pointer-events: none !important;
	z-index: 2 !important;
}

/* Action Buttons Container (Left Aligned) */
.star-product-highlight__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.85rem;
	align-items: center;
	justify-content: flex-start;
	width: 100%;
	margin-top: 0.85rem;
}

/* Base button styles */
.star-product-highlight__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.6rem;
	padding: 0.75rem 1rem;
	min-height: 2.75rem;
	border-radius: 6px;
	font-size: 0.825rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	text-decoration: none !important;
	color: #ffffff !important;
	line-height: 1.2;
	cursor: pointer;
	box-sizing: border-box;
	transition: background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.star-product-highlight__btn:hover {
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.star-product-highlight__btn-icon {
	width: 1rem;
	height: 1rem;
	flex-shrink: 0;
	display: block;
}

.star-product-highlight__btn-text {
	display: inline-block;
	color: #ffffff !important;
	line-height: 1.2;
}

/* Primary Button (Star Orange) */
.star-product-highlight__btn--primary {
	background-color: #ff6f00;
}

.star-product-highlight__btn--primary:hover {
	background-color: #e65100;
}

/* Secondary Button (Star Cyan / Blue) */
.star-product-highlight__btn--secondary {
	background-color: #0099ba;
}

.star-product-highlight__btn--secondary:hover {
	background-color: #00829f;
}

/* Editor inline text styling */
.editor-styles-wrapper .star-product-highlight .star-product-highlight__btn-text[contenteditable="true"]:focus {
	outline: 1px dashed rgba(255, 255, 255, 0.8);
	outline-offset: 2px;
}

/* Responsive Breakpoint */
@media (max-width: 860px) {
	.star-product-highlight {
		padding: 1rem;
		gap: 1.25rem;
	}

	.star-product-highlight:has(> .star-product-highlight__content) {
		grid-template-columns: 1fr;
		gap: 1.25rem;
	}

	.star-product-highlight__title {
		font-size: 1.4rem !important;
	}

	.star-product-highlight__body {
		grid-template-columns: 1fr;
		gap: 1.5rem;
	}

	.star-product-highlight__actions {
		flex-direction: column;
		align-items: stretch;
	}

	.star-product-highlight__btn {
		width: 100%;
		text-align: center;
	}
}
