/**
 * Highlights — pills and the community notification bar.
 *
 * Colour lives in module.php (rh_highlight_palette), not here, because the
 * values are editable per row. This file is layout only.
 *
 * Deliberately no icons: the spec row (story / beds / baths / car / sq ft) is
 * outlined line icons, and a flag drawn the same way reads as a spec rather
 * than a promotion. Pills are solid fills so the two can never be confused.
 */

/*
 * The pills sit in their own Avada column beside the status badge, and left to
 * itself that column shrinks to the width of its widest pill — so a second
 * pill wrapped *inside* it and landed indented under the badge.
 *
 * Intrinsic sizing (`width: max-content`) is not the fix: Avada's percentage
 * right-spacing resolves against the width max-content has just produced and
 * eats back into it, so the column still came up a few pixels short. Sizing
 * the column explicitly avoids the whole circularity — on a detail page it
 * takes the space left over, on a card it takes the whole line.
 *
 * Spacing between pills is a margin rather than `gap` for the same family of
 * reasons: margins are always counted in a column's content width.
 *
 * The column's own left padding goes too. On the status badge the coloured box
 * *is* the column, so its padding sits inside the colour; on a pill the box is
 * the pill, so the same padding would shunt it 10px right of the badge above.
 */

.rh-highlights {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	/* The single gap value. Flattened card rows set the same 8px on the row. */
	gap: 8px;
}

.rh-pill {
	display: inline-flex;
	align-items: center;
	font-family: var( --awb-typography4-font-family, "Lato", Arial, Helvetica, sans-serif );
	font-weight: var( --awb-typography4-font-weight, 700 );
	font-size: 15px;
	line-height: var( --awb-typography4-line-height, 1.2 );
	letter-spacing: var( --awb-typography4-letter-spacing, 0 );
	text-transform: uppercase;
	padding: 5px 15px;
	/* Square, like the site's own status badge — a 2px radius and a drop
	   shadow made the chip's bottom edge read lower than the badge's. */
	border-radius: 0;
	white-space: nowrap;
	margin: 0;
}

/* ---------------------------------------------------------------------------
 * Wrapping
 *
 * The pills sit in their own Avada column next to the status badge. Left to
 * itself that column shrinks to the width of its widest pill, so a second pill
 * wraps *inside* the column and lands indented under the badge. Refusing to
 * shrink makes the whole group move to the next line instead, flush with the
 * left edge, which is the only tidy way for it to break.
 * ------------------------------------------------------------------------ */

/*
 * The chips are flattened out of their Avada column so the status badge and
 * the pills become siblings in one wrapping flex row. Sizing the column was a
 * dead end: wide enough to hold the pills and it overflowed the photo on a
 * narrow card; narrow enough to fit and the pills wrapped inside it, indented
 * under the badge. As direct children of the row they simply flow and wrap
 * against its left edge, which is what was wanted all along.
 */

.card-top-left-position .rh-pill-col,
.card-top-left-position .rh-pill-col > .fusion-column-wrapper,
.card-top-left-position .rh-highlights-slot,
.card-top-left-position .rh-highlights,
.inventory-no-wrap-position .rh-pill-col,
.inventory-no-wrap-position .rh-pill-col > .fusion-column-wrapper,
.inventory-no-wrap-position .rh-highlights-slot,
.inventory-no-wrap-position .rh-highlights {
	/* !important: Avada's own column rules outrank this selector. */
	display: contents !important;
}

/* ---------------------------------------------------------------------------
 * Pills over a card photo
 *
 * The site's own .card-top-left-position rule (position:absolute; top:25px;
 * left:30px) measures from the Avada column, which on the community cards
 * starts 30px of padding above the photo — so the pill lands off the image,
 * and by a different amount at every breakpoint. The column *wrapper* begins
 * exactly at the photo's top-left corner, so making that the containing block
 * gives a true 12px inset at any width. The margin reset undoes the negative
 * gutter Avada gives a nested row.
 * ------------------------------------------------------------------------ */

.fusion-column-wrapper:has( > .card-top-left-position.rh-card-pills ) {
	position: relative;
}

.card-top-left-position.rh-card-pills {
	top: 12px;
	left: 12px;
	right: auto;
}

/* Standalone use of the shortcode's own on-photo modifier. */
.rh-highlights--on-photo {
	position: absolute;
	top: 12px;
	left: 12px;
	right: 12px;
	z-index: 2;
}

/* Above the title on detail pages, under the breadcrumb. */
/*
 * Padding, not margin. The pill row sits inside an Avada text block, and a
 * margin on it collapses straight through that wrapper and up against the
 * breadcrumb above — which left no gap at all. Padding cannot collapse, so
 * these are the numbers that actually render: 14px clear of the breadcrumb,
 * and 6 + 2 + the title's own 10px below it.
 */
/*
 * In-flow chip rows (both detail templates) sit 10px under the breadcrumb.
 * The page title below carries its own 10px top margin, so the chips end up
 * with the same 10px above and below without a second number anywhere.
 */
.rh-highlights--above-title,
.inventory-no-wrap-position.rh-card-pills {
	margin: 10px 0 0 !important;
	padding: 0 !important;
}

/* ---------------------------------------------------------------------------
 * Notification bar
 *
 * A tinted band with an accent rule, not a filled slab. A saturated fill at
 * this size reads as a button or a second promo bar competing with the one in
 * the header; a wash of the same colour carries the message without shouting.
 * The chosen colour drives the tint and the rule only — the words stay navy,
 * so legibility never depends on which colour was picked. No icon, by request.
 * ------------------------------------------------------------------------ */

/*
 * The pill row. Avada writes `width:104% !important` INLINE on the nested row,
 * so no stylesheet rule can shrink it — that is why the chips used to run past
 * the photo instead of wrapping. Padding on a border-box row pulls the content
 * edge back inside the card without touching that width, and one `gap` gives
 * the same 8px between chips in both directions. Every chip row carries
 * .rh-card-pills, so this is the only spacing code for all of them.
 */
.rh-card-pills {
	box-sizing: border-box !important;
	margin: 0 !important;
	padding-right: calc( 4% + 12px ) !important;
	gap: 8px !important;
	align-items: flex-start !important;
}

.rh-card-pills > .fusion-layout-column,
.rh-card-pills > .fusion-layout-column > .fusion-column-wrapper {
	margin: 0 !important;
}

.rh-card-pills .rh-pill {
	margin: 0 !important;
}

.rh-card-pills .rh-highlights {
	margin: 0 !important;
	display: contents !important;
}


/*
 * One notice component, one set of spacing values. Detail pages and cards get
 * identical padding, gap, bottom margin and type — the markup differs only in
 * where it sits, never in how it is spaced. Change spacing in these tokens and
 * every placement moves together.
 */
.rh-notice {
	--rh-notice-pad-y: 14px;
	--rh-notice-pad-x: 18px;
	--rh-notice-gap: 14px;
	--rh-notice-mb: 14px;

	display: flex;
	align-items: center;
	gap: var( --rh-notice-gap );
	flex-wrap: wrap;
	padding: var( --rh-notice-pad-y ) var( --rh-notice-pad-x );
	margin: 0 0 var( --rh-notice-mb );
	text-align: left;
	font-family: var( --awb-typography4-font-family, "Lato", Arial, Helvetica, sans-serif );
	border-style: solid;
	border-width: 0 0 0 4px;
	border-radius: 2px;
}

/* The slot never adds spacing of its own — the notice owns all of it. */
.rh-notice-slot,
.rh-notice-slot > .fusion-text {
	margin: 0 !important;
	padding: 0 !important;
}

/* !important: Avada's global paragraph rule adds a 20px bottom margin here,
   which made the band's bottom padding read 20px deeper than its top. */
.rh-notice .rh-notice-text {
	margin: 0 !important;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.35;
	color: #013c5b;
}

.rh-notice-text small {
	display: block;
	margin-top: 2px;
	font-size: 13px;
	font-weight: 400;
	line-height: 1.45;
	color: #6e7b85;
}

.rh-notice-link {
	font-size: 13px;
	font-weight: 700;
	white-space: nowrap;
	color: #013c5b;
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* Avada puts an ID on its link-underline rule, so beating it needs both. */
.awb-link-decoration #wrapper .rh-notice-link {
	text-decoration: underline !important;
}

@media ( max-width: 640px ) {
	.rh-notice {
		--rh-notice-gap: 10px;
		--rh-notice-pad-y: 12px;
		--rh-notice-pad-x: 14px;
	}

	.rh-notice-text {
		font-size: 14px;
	}
}
