/**
 * FDA Nutrition Facts panel.
 *
 * Everything is scoped under .sfnl-label and every inherited property a
 * theme is likely to set is reset explicitly, so theme styles cannot bleed
 * into the panel and the panel cannot bleed out.
 *
 * Specificity contract: the cell reset below is (0,2,1). Every rule that
 * overrides it is written as `.sfnl-label .sfnl-table .modifier` (0,3,0) or
 * stronger, so modifiers always win regardless of source order. Do not add
 * a bare `.sfnl-label .modifier` rule for a cell property - it will lose.
 *
 * Sizes are in px on purpose: a Nutrition Facts panel is a fixed-geometry
 * regulated document, and relative units would let a theme's root font size
 * distort the proportions.
 *
 * @package SF_Nutritional_Labels
 */

.sfnl-label {
	background: #fff;
	box-sizing: border-box;
	color: #000;
	font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
	font-size: 11px;
	font-style: normal;
	font-weight: 400;
	letter-spacing: normal;
	line-height: 1.15;
	margin: 0 0 1.5em;
	text-align: left;
	text-transform: none;
	text-rendering: optimizeLegibility;
}

.sfnl-label *,
.sfnl-label *:before,
.sfnl-label *:after {
	box-sizing: border-box;
}

.sfnl-label .sfnl-table {
	background: #fff;
	border: 2px solid #000;
	border-collapse: collapse;
	border-spacing: 0;
	color: #000;
	font-size: 11px;
	margin: 0;
	table-layout: auto;
	width: 100%;
}

/* Cell reset - (0,2,1). See the specificity contract above. */
.sfnl-label .sfnl-table th,
.sfnl-label .sfnl-table td {
	background: none;
	border: 0;
	color: #000;
	font-size: inherit;
	font-weight: 400;
	line-height: 1.15;
	padding: 1px 5px;
	text-align: left;
	vertical-align: baseline;
}

.sfnl-label .sfnl-table .sfnl-right {
	text-align: right;
}

.sfnl-label .sfnl-table .sfnl-pct {
	font-weight: 700;
	text-align: right;
	white-space: nowrap;
}

.sfnl-label .sfnl-sr-only {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	white-space: nowrap;
	width: 1px;
}

/* ---------------------------------------------------------------------
 * Rules. Hairline first so the thick and medium bars win when a row
 * carries both classes.
 * ------------------------------------------------------------------ */

.sfnl-label .sfnl-table .sfnl-row-nutrient > th,
.sfnl-label .sfnl-table .sfnl-row-nutrient > td,
.sfnl-label .sfnl-table .sfnl-row-micro > th,
.sfnl-label .sfnl-table .sfnl-row-micro > td {
	border-top: 1px solid #000;
}

.sfnl-label .sfnl-table .sfnl-rule-medium > th,
.sfnl-label .sfnl-table .sfnl-rule-medium > td {
	border-top: 6px solid #000;
}

.sfnl-label .sfnl-table .sfnl-rule-thick > th,
.sfnl-label .sfnl-table .sfnl-rule-thick > td {
	border-top: 9px solid #000;
}

/* ---------------------------------------------------------------------
 * Shared type
 * ------------------------------------------------------------------ */

.sfnl-label .sfnl-title {
	display: block;
	font-weight: 800;
	letter-spacing: -1px;
	line-height: 1.02;
}

.sfnl-label .sfnl-table .sfnl-row-serving-size > th,
.sfnl-label .sfnl-table .sfnl-row-serving-size > td,
.sfnl-label .sfnl-table .sfnl-row-dv-head > th,
.sfnl-label .sfnl-table .sfnl-row-dv-head > td {
	font-weight: 700;
}

.sfnl-label .sfnl-table .sfnl-row-nutrient b {
	font-weight: 700;
}

.sfnl-label .sfnl-table .sfnl-row-nutrient em {
	font-style: italic;
}

.sfnl-label .sfnl-table .sfnl-indent-1 > th {
	padding-left: 17px;
}

.sfnl-label .sfnl-table .sfnl-indent-2 > th {
	padding-left: 29px;
}

/* ---------------------------------------------------------------------
 * Single item: the vertical panel
 * ------------------------------------------------------------------ */

.sfnl-label--single {
	max-width: 280px;
}

.sfnl-label--single .sfnl-table .sfnl-row-title > td {
	padding-bottom: 0;
	padding-top: 0;
}

.sfnl-label--single .sfnl-title {
	font-size: 35px;
}

.sfnl-label--single .sfnl-table .sfnl-row-servings > td {
	border-top: 1px solid #000;
	padding-top: 2px;
}

.sfnl-label--single .sfnl-table .sfnl-row-amount-per > td {
	font-size: 10px;
	font-weight: 700;
	padding-bottom: 0;
	padding-top: 1px;
}

.sfnl-label--single .sfnl-table .sfnl-row-calories > th {
	font-size: 25px;
	font-weight: 800;
	letter-spacing: -0.6px;
	padding-bottom: 1px;
	padding-top: 0;
}

.sfnl-label--single .sfnl-table .sfnl-row-calories > td {
	font-size: 33px;
	font-weight: 800;
	letter-spacing: -1px;
	padding-bottom: 1px;
	padding-top: 0;
	text-align: right;
	vertical-align: bottom;
}

.sfnl-label--single .sfnl-table .sfnl-row-dv-head > td {
	font-size: 10px;
}

.sfnl-label--single .sfnl-table .sfnl-row-micro > th {
	font-weight: 400;
}

.sfnl-label--single .sfnl-table .sfnl-row-footnote > td {
	font-size: 9px;
	line-height: 1.2;
	padding-bottom: 3px;
	padding-top: 3px;
}

/* ---------------------------------------------------------------------
 * Two or more items: the horizontal panel
 * ------------------------------------------------------------------ */

.sfnl-label--multi .sfnl-scroll {
	-webkit-overflow-scrolling: touch;
	max-width: 100%;
	overflow-x: auto;
}

.sfnl-label--multi .sfnl-table {
	border-bottom-width: 7px;
	font-size: 10px;
	/* Sized to its content, like the printed panel, rather than stretched to
	   the container - stretching hands all the slack to the last column. */
	width: auto;
}

.sfnl-label--multi .sfnl-title {
	font-size: 23px;
}

.sfnl-label--multi .sfnl-table .sfnl-title-cell {
	border-bottom: 1px solid #000;
	padding-bottom: 1px;
	vertical-align: bottom;
	width: 175px;
}

/* Vertical rule opening each item's pair of columns. */
.sfnl-label--multi .sfnl-table .sfnl-col-start {
	border-left: 1px solid #000;
}

.sfnl-label--multi .sfnl-table .sfnl-item-name {
	border-bottom: 9px solid #000;
	font-size: 9px;
	font-weight: 400;
	line-height: 1.1;
	max-width: 135px;
	text-align: right;
	vertical-align: bottom;
	white-space: normal;
}

.sfnl-label--multi .sfnl-table .sfnl-row-servings > th {
	font-weight: 400;
}

.sfnl-label--multi .sfnl-table .sfnl-row-calories > th {
	padding-bottom: 0;
	padding-top: 1px;
}

.sfnl-label--multi .sfnl-amount-per {
	display: block;
	font-size: 8px;
	font-weight: 700;
}

.sfnl-label--multi .sfnl-calories-word {
	display: block;
	font-size: 22px;
	font-weight: 800;
	letter-spacing: -0.6px;
	line-height: 1.05;
}

.sfnl-label--multi .sfnl-table .sfnl-calories-value {
	font-size: 28px;
	font-weight: 800;
	letter-spacing: -1px;
	padding-bottom: 1px;
	text-align: right;
	vertical-align: bottom;
}

.sfnl-label--multi .sfnl-table .sfnl-row-dv-head > td {
	font-size: 8px;
	text-align: right;
}

.sfnl-label--multi .sfnl-table .sfnl-amt {
	min-width: 42px;
	padding-right: 2px;
	text-align: left;
	white-space: nowrap;
}

.sfnl-label--multi .sfnl-table .sfnl-pct {
	min-width: 34px;
	padding-left: 2px;
}

.sfnl-label--multi .sfnl-table .sfnl-row-nutrient > th {
	white-space: nowrap;
}

.sfnl-label--multi .sfnl-table .sfnl-micro-label {
	border-left: 1px solid #000;
	font-weight: 400;
	white-space: nowrap;
	width: 95px;
}

.sfnl-label--multi .sfnl-table .sfnl-footnote-cell {
	font-size: 8px;
	line-height: 1.2;
	padding-bottom: 3px;
	padding-top: 3px;
	vertical-align: top;
	width: 175px;
}

/* ---------------------------------------------------------------------
 * Ingredients and allergens
 * ------------------------------------------------------------------ */

.sfnl-label .sfnl-ingredients,
.sfnl-label .sfnl-allergens {
	color: #000;
	font-size: 11px;
	line-height: 1.35;
	margin: 6px 0 0;
	max-width: 520px;
	padding: 0;
}

.sfnl-label .sfnl-allergens strong {
	font-weight: 700;
}
