/* ==========================================================================
   Smart Gadgets Reviews – optional article sections (block patterns)
   --------------------------------------------------------------------------
   Styles the boxes inserted from the editor inserter > Patterns >
   "Article sections" (files in patterns/). Loaded on the site and inside
   the block editor, so boxes look the same while writing.
   Hex values = brand colours; Elementor global colours are used where the
   variables exist (site), the hex fallback otherwise (editor).

     1. Box frame and label
     2. Lists (key takeaways, pros/cons)
     3. Pros and cons columns
     4. Tables (specifications, comparison)
     5. Product box (affiliate)
     6. Author note

   Stage 07.1: the Pros and cons, Specifications, Comparison table and
   Product box patterns were retired (replaced by the Product blocks).
   Their styles (3, 4, 5) are kept so any copy pasted from an older draft
   still renders correctly. Safe to remove once no content uses them.
   ========================================================================== */

/* 1. Box frame and label -------------------------------------------------- */
.sgr-box {
	--sgr-box-accent: var(--e-global-color-primary, #155EEF);
	box-sizing: border-box;
	margin-block: 32px;
	padding: 24px 28px;
	border: 1px solid #EAECF0;
	border-radius: 12px;
	background: #FFFFFF;
	color: #344054;
}
.sgr-box > :first-child,
.sgr-box__part > :first-child { margin-top: 0; }
.sgr-box > :last-child,
.sgr-box__part > :last-child { margin-bottom: 0; }

.sgr-box .sgr-box__label {
	margin: 0 0 12px;
	color: #101828;
	font-size: 14px;
	font-weight: 700;
	letter-spacing: 0.06em;
	line-height: 1.4;
	text-transform: uppercase;
}

/* 2. Lists ------------------------------------------------------------------ */
.sgr-box .sgr-list {
	margin: 0;
	padding: 0;
	list-style: none;
}
.sgr-box .sgr-list li {
	position: relative;
	margin: 0 0 10px;
	padding-inline-start: 30px;
	line-height: 1.6;
}
.sgr-box .sgr-list li:last-child { margin-bottom: 0; }
.sgr-box .sgr-list li::before {
	position: absolute;
	inset-inline-start: 0;
	top: 0.2em;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	font-size: 12px;
	font-weight: 700;
	line-height: 1;
}
.sgr-list--check li::before { content: "\2713"; background: #EFF4FF; color: #155EEF; }
.sgr-list--pros li::before { content: "+"; background: #ECFDF3; color: #067647; font-size: 15px; }
.sgr-list--cons li::before { content: "\2212"; background: #FEF3F2; color: #B42318; font-size: 15px; }

.sgr-box--takeaways {
	border-color: #D1E0FF;
	border-inline-start: 4px solid var(--sgr-box-accent);
	background: #F5F8FF;
}

/* 3. Pros and cons ------------------------------------------------------------ */
.sgr-box--proscons { padding: 0; overflow: hidden; }
.sgr-box .sgr-proscons {
	gap: 0;
	margin: 0;
}
.sgr-box .sgr-box__part { padding: 24px 28px; }
.sgr-box__part--pros { background: #F6FEF9; }
.sgr-box__part--cons { background: #FFFBFA; }
.sgr-box__part--pros + .sgr-box__part--cons { border-inline-start: 1px solid #EAECF0; }
.sgr-box__part--pros .sgr-box__label { color: #067647; }
.sgr-box__part--cons .sgr-box__label { color: #B42318; }

@media (max-width: 781px) {
	/* Core stacks the columns below 782px. */
	.sgr-box__part--pros + .sgr-box__part--cons {
		border-inline-start: 0;
		border-top: 1px solid #EAECF0;
	}
}

/* 4. Tables ------------------------------------------------------------------- */
.sgr-box .sgr-table {
	margin: 0;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}
.sgr-box .sgr-table table {
	width: 100%;
	margin: 0;
	border-collapse: collapse;
	font-size: 15px;
	line-height: 1.5;
}
.sgr-box .sgr-table th,
.sgr-box .sgr-table td {
	padding: 12px 14px;
	border: 0;
	border-bottom: 1px solid #EAECF0;
	text-align: start;
	vertical-align: top;
}
.sgr-box .sgr-table thead th {
	background: #F5F7FA;
	color: #101828;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	border-bottom: 1px solid #D0D5DD;
}
.sgr-box .sgr-table tbody tr:last-child td { border-bottom: 0; }
.sgr-box .sgr-table tbody td:first-child {
	color: #101828;
	font-weight: 600;
}
.sgr-table--specs tbody td:first-child { width: 38%; }
.sgr-table--compare table { min-width: 560px; }
.sgr-table--compare tbody td:first-child { white-space: nowrap; }
.sgr-box .sgr-table figcaption {
	margin-top: 8px;
	font-size: 13px;
	color: #667085;
}

/* 5. Product box ------------------------------------------------------------- */
.sgr-box--product {
	border-color: #D1E0FF;
	box-shadow: 0 1px 2px rgba(16, 24, 40, .05);
}
.sgr-box--product .sgr-box__label { color: var(--sgr-box-accent); }
.sgr-box .sgr-product__name {
	margin: 0 0 8px;
	color: #101828;
	font-size: 22px;
	font-weight: 700;
	line-height: 1.3;
}
.sgr-box--product .wp-block-buttons { margin-top: 16px; }
.sgr-box--product .wp-block-button__link {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 10px 24px;
	border-radius: 6px;
	background: var(--sgr-box-accent);
	color: #FFFFFF;
	font-size: 15px;
	font-weight: 600;
	text-decoration: none;
}
.sgr-box--product .wp-block-button__link:hover,
.sgr-box--product .wp-block-button__link:focus-visible {
	background: #101828;
	color: #FFFFFF;
}

/* 6. Author note --------------------------------------------------------------- */
.sgr-box--note {
	border: 0;
	border-inline-start: 4px solid #101828;
	border-radius: 0 12px 12px 0;
	background: #F5F7FA;
	font-style: italic;
}
.sgr-box--note .sgr-box__label { font-style: normal; }

@media (max-width: 767px) {
	.sgr-box { margin-block: 24px; padding: 20px; }
	.sgr-box--proscons { padding: 0; }
	.sgr-box .sgr-box__part { padding: 20px; }
	.sgr-box .sgr-table th,
	.sgr-box .sgr-table td { padding: 10px 12px; }
}
