/**
 * The flexi search listings: Interest Groups, Resources, Research, and any page
 * holding the widget (see Flexi_Listing_Pages).
 *
 * Figma: "Teal Interest Groups Listing - Desktop" 307:21304 in the OTA Design
 * file iJIMvo6qjZanmK5Iza7bUs. Section 307:21814, search field 2366:19494,
 * grid 307:22061, card 328:4585.
 *
 * WHAT THIS FILE IS FOR. The listing is the kiosk's Agend Flexi Search widget in
 * an Elementor archive template, so the markup below belongs to
 * `iugo-membership-kiosk/templates/shortcodes/flexi-search/search-form.php`. All
 * OTA work stays in this plugin, so that template is not ours to change: the form
 * and the card are reshaped from the outside instead. Only `.ota-listing-badge`
 * is our own element, printed by `Interest_Groups_Listing::render_badge()` and
 * `Resources_Listing::render_badge()`.
 *
 * WHERE THE RULES BEING OVERRIDDEN COME FROM. The kiosk, in every case: its
 * flexi-search styles, compiled into
 * `iugo-membership-kiosk/public/build/assets/agend-base-*.css`. The comments
 * below used to credit `iugo-membership-kiosk-products-extension`, which does
 * not contain a single `agend-flexi-search-result` reference on this site, so
 * anyone following them went to the wrong repo. Corrected after review on
 * PR #8, second round.
 *
 * THE DESIGNER DREW THIS WIDGET. The frame's own layer names are
 * `agend-flexi-search-form__search-query` and
 * `Input <instance>_search_query`, so the measurements below are of the real
 * component rather than of something that has to be approximated into it.
 *
 * SCOPED TO THE TWO ROUTES BY A PLUGIN BODY CLASS. `ota-flexi-listing` is added
 * by `Interest_Groups_Listing::body_class()` and `Resources_Listing::body_class()`
 * on their own archives only. Until 8 Sep 2026 the scope was WordPress's own
 * `post-type-archive-interest_group`; the Resources listing reuses this whole
 * sheet, so the two routes now share one class. The same widget appears
 * elsewhere on this site with a different design behind it, and the two
 * `enqueue()` methods keep this file off those pages, but the body scope means
 * load order cannot leak it either.
 *
 * NOTE FOR THE ELEMENTOR EDITOR: the archive template's preview does not carry
 * that body class, so the cards render unstyled on the canvas and correctly on the
 * front end. Check the page itself.
 *
 * THREE NESTED THEMES, WHICH IS THE THING THAT MAKES THIS PAGE READ CORRECTLY.
 * The frame uses `bar/*` variables at three different resolutions: the band is
 * the page theme (teal in the frame, navy per the Customizer's Interest Groups
 * default), the body section resolves `bar/background` to #F0E7D8, which is the
 * `ash` theme, and the card resolves it to #FFFFFF with #003038 text, which is
 * `white`. So the section wants `ota-theme--ash` and the widget wants
 * `ota-theme--white`, both set in Elementor's CSS Classes field. Every colour
 * below is read as a role rather than a hex so that nesting is what decides.
 */

/* ------------------------------------------------------------- the page -- */

/* A THEME CLASS PAINTS, IT DOES NOT ONLY DECLARE. This is the single most useful
   thing to know about `Colour_Themes` when nesting one: alongside the `--ota-*`
   roles, `.ota-theme--<slug>` sets `background` to that theme's background role.
   So `ota-theme--white` on the widget, which is what gives the cards their white
   palette, also filled the entire widget wrapper white and swallowed the cream
   section behind it.

   The class is still the right way to nest the palette, so the roles are kept and
   only the fill is dropped. Colour_Themes emits the fill twice: once as
   `.ota-theme--white,body.ota-theme--white`, topping out at (0,1,1), and once as
   `:where(.ota-theme--white)` at (0,0,0). This selector is (0,3,1) and beats both,
   and the scope keeps it off the same class used anywhere else on the site.

   Verified by walking the grid's real ancestor chain rather than by inference: the
   nearest painted ancestor is `div.elementor-element-9d5691f.ota-theme--white`, not
   `main#agendtheme-content`, which an earlier pass of this file wrongly blamed. */
body.ota-flexi-listing .elementor-location-archive .ota-theme--white {
	background-color: transparent;
}

/* The cream comes from the outer section's own `ota-theme--ash`, by the same
   mechanism, and is correct as it stands. The body underneath is navy, from
   `body.ota-page-theme--navy`, which is the Interest Groups default in the
   Customizer. So if the cream ever stops reaching the window edges the thing to
   check is Elementor's Stretch Section setting on that section, not this file:
   without the stretch the edges go navy. */

/* THE WHITE LINE UNDER THE BAND WAS 16px OF `main` SHOWING THROUGH. Measured in the
   browser rather than reasoned about: the band ends at 431.5 and the cream section
   starts at 447.5, because Elementor gives its own document wrapper
   `margin-top: 16px`. The band and the section are siblings inside the white
   `main#agendtheme-content`, so those 16px were a full-width white stripe. */
body.ota-flexi-listing .elementor-location-archive {
	margin-top: 0;
}

/* THE FRAME'S OWN SECTION PADDING: `pt-[64px]` and `pb-[var(--spacing/96,96px)]` on
   node 307:21814. Measured before this, the gap above the search field was 26px, not
   64, and it was made of two things that have nothing to do with the design:
   Elementor's default 10px on `.elementor-widget-wrap` and the theme's 16px margin
   on `.agend-flexi-search-form`. Both are zeroed below so the 64 here is the whole
   distance rather than a number that happens to add up with two others.

   THIS FILE NOW OWNS THOSE TWO NUMBERS. Elementor writes the section's padding at
   (0,3,0) and this is (0,3,1), so setting padding on that section in the editor will
   no longer take effect. Change it here. */
body.ota-flexi-listing .elementor-location-archive .ota-theme--ash {
	padding-top: 64px;
	padding-bottom: 96px;
}

body.ota-flexi-listing .elementor-location-archive .elementor-widget-wrap {
	padding: 0;
}

.ota-flexi-listing .agend-flexi-search-form {
	margin-top: 0;
	margin-bottom: 0;
}

/* THE SAME BAND ON A PAGE. A page holding the widget (`/news`, Teamwork
   49849939) is dressed by `Flexi_Listing_Pages`: the outermost layout element
   around the widget gets `ota-flexi-listing-band`, plus `--fill` and (unless the
   editor chose a theme) `ota-theme--ash` when it has no background of its own;
   the widget gets `ota-theme--white`. These are the three archive rules above,
   keyed to that band class instead of `.elementor-location-archive`, which a page
   does not have. The band rule is (0,4,1) to beat Elementor's own section padding
   at (0,3,0), so this file owns the band padding here too.

   On a page the band is whatever section the editor put the widget in, which
   may hold other things (a CTA card, a second column), so the fill and padding
   rules below are keyed to the widget itself, not to everything in the band. */
body.ota-flexi-listing .ota-flexi-listing-band .elementor-widget-agend-flexi-search.ota-theme--white {
	background-color: transparent;
}

body.ota-flexi-listing .elementor .elementor-element.ota-flexi-listing-band {
	padding-top: 64px;
	padding-bottom: 96px;
}

body.ota-flexi-listing .elementor .elementor-element.ota-flexi-listing-band.ota-flexi-listing-band--fill {
	/* EDGE TO EDGE WITHOUT STRETCH SECTION. The archive templates reach the
	   window edges with Elementor's Stretch Section, which an editor dropping the
	   widget on a page will not have set, and the page content sits inside the
	   theme's 1140px container. So the band paints its own colour out to the
	   edges: the shadow carries the section's background role sideways, and the
	   clip-path keeps it from spilling above or below. Layout is untouched, so
	   nothing inside moves. Only with `--fill`: a section whose background the
	   editor set with Elementor's own control keeps it to the section, without
	   the page's colour either side. */
	box-shadow: 0 0 0 100vmax var( --ota-background, #f0e7d8 );
	clip-path: inset( 0 -100vmax );
}

body.ota-flexi-listing .ota-flexi-listing-band .elementor-widget-wrap:has( > .elementor-widget-agend-flexi-search ) {
	padding: 0;
}

/* ------------------------------------------------------- the search form -- */

/* Neither of these is in the design. They are widget text fields with defaults
   rather than switches, so emptying them in Elementor leaves an empty heading
   taking up space: hiding them here is the only lever that removes them. */
.ota-flexi-listing .agend-flexi-search-form__title,
.ota-flexi-listing .agend-flexi-search-results__title {
	display: none;
}

.ota-flexi-listing .agend-flexi-search-form__form {
	display: flex;
	flex-direction: column;
	align-items: center;
}

/* The field: 780x50 centred, radius 24 (spacing/24), literally white in the
   frame rather than a role, because it sits on the ash section and is drawn as
   white there. */
.ota-flexi-listing .agend-flexi-search-form__search-query {
	position: relative;
	display: flex;
	align-items: center;
	width: 100%;
	max-width: 780px;
	min-height: 50px;
	margin-inline: auto;

	background-color: #ffffff;
	border-radius: 24px;
}

/* Kept for anyone using a screen reader and taken out of the layout, because the
   design labels the field with its placeholder alone. */
.ota-flexi-listing .agend-flexi-search-form__search-query-label {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip-path: inset( 50% );
	white-space: nowrap;
	border: 0;
}

.ota-flexi-listing .agend-flexi-search-form__search-query-input {
	flex: 1 1 auto;
	min-width: 0;
	align-self: stretch;

	/* 23.93px in the frame, and the right side has to clear the icon: 17px of
	   inset plus the 16px glyph plus a little air. */
	padding: 0 48px 0 24px;

	background-color: transparent;
	border: 0;
	border-radius: inherit;
	box-shadow: none;

	color: var( --ota-text, #003038 );
	font-size: 15px;
	font-weight: 300;
	line-height: 24.75px;
}

.ota-flexi-listing .agend-flexi-search-form__search-query-input::placeholder {
	color: var( --ota-text, #003038 );
	opacity: 1;
}

.ota-flexi-listing .agend-flexi-search-form__search-query-input:focus-visible {
	outline: 2px solid var( --ota-text, #003038 );

	/* Inside the pill: the field is the full width of its rounded container, so a
	   ring drawn outside would be clipped at both ends. */
	outline-offset: -4px;
}

/* The magnifier. 16px at 17px from the right edge, vertically centred, which in
   the frame is `left: calc(50% + 365px)` against a 780px field. Flexi renders a
   real submit button here, so it keeps working without JavaScript and simply
   stops looking like a button. */
.ota-flexi-listing .agend-flexi-search-form__submit-button {
	position: absolute;
	top: 50%;
	right: 17px;
	transform: translateY( -50% );

	display: flex;
	align-items: center;
	justify-content: center;
	width: 16px;
	height: 16px;
	padding: 0;

	background: none;
	border: 0;

	color: var( --ota-text, #003038 );
	font-size: 16px;
	line-height: 1;
	cursor: pointer;
}

.ota-flexi-listing .agend-flexi-search-form__submit-button-label {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip-path: inset( 50% );
	white-space: nowrap;
	border: 0;
}

/* --------------------------------------------------------------- the grid -- */

/* 52px below the field, per the frame's `pb-[52px]` on the block that holds it.
   The theme adds 2.3125rem of padding-top here as well, so that is zeroed rather
   than left to stack into 89px. */
.ota-flexi-listing .agend-flexi-search-results {
	margin-top: 52px;
	padding-top: 0;
}

/* The theme draws a 1px rule at 30% opacity above the results as a `:before`.
   There is no such rule in the design, and with the section now cream it read as
   a seam across the page. */
.ota-flexi-listing .agend-flexi-search-results::before {
	content: none;
}

/* 1060px wide, three columns, 24px gutter. The column count is the widget's own
   Columns control, which writes --columns; the fallback is the design's three so
   a widget saved before that control was touched still lays out correctly. */
.ota-flexi-listing .agend-flexi-search-results__posts {
	display: grid;
	grid-template-columns: repeat( var( --columns, 3 ), minmax( 0, 1fr ) );

	/* EACH ROW SIZES TO ITS OWN TALLEST CARD, which is what the frame draws: its
	   grid has nine different row heights from 478 to 565px.
	   `iugo-membership-kiosk` sets `grid-auto-rows: 1fr` here,
	   and `1fr` makes every row the same height as every other, sized to the tallest
	   card anywhere in the grid. With 26 cards that meant one long description set
	   the height of all nine rows and left a wide empty band in most cards. `auto`
	   sizes each row to its own content, and the cards still stretch to match each
	   other within a row because that is grid's default alignment. */
	grid-auto-rows: auto;

	gap: 24px;
	width: 100%;
	max-width: 1060px;
	margin-inline: auto;
}

/* ---------------------------------------------------------------- the card -- */

.ota-flexi-listing .agend-flexi-search-result {
	display: flex;
	flex-direction: column;

	background-color: var( --ota-background, #ffffff );

	/* The badge is printed inside the card body by the only hook the flexi
	   template offers, and the design puts it over the image. This is what lets
	   it move. */
	position: relative;

	/* radius/md, the design's global corner. Deliberately the literal 14px and not
	   the theme's `--at-border-radius`, which is 4px on this site and belongs to a
	   different design language.

	   `clip` rather than `hidden` so the corners cut the picture without creating
	   a scroll container. That only works once the padding below is gone: with the
	   image inset, its own square corners sit inside the rounded card and the
	   radius reads as broken. */
	border-radius: 14px;
	overflow: clip;

	/* THE CARD IS FLUSH. Three separate rules had to be undone to get there:
	   `iugo-membership-kiosk` sets `padding: var(--gutter)` and
	   `border: 1px solid` (no colour, so currentColor), and the theme adds a
	   box-shadow and a 1.25rem gap. The design has none of them: the picture runs
	   to the card edge and the body supplies its own 24px. */
	padding: 0;
	border: 0;
	box-shadow: none;
	gap: 0;
}

/* EVERY PICTURE IS THE SAME HEIGHT, which is a deliberate departure from the frame.
   The frame's grid has per-row heights from 478 to 565px over a fixed 260.75px body,
   so there the picture is what stretches and no two rows match. Asked for by Bryce
   on 19 Aug 2026: the images should all be the same height. So the slot is fixed at
   249px, the shortest of those rows less the body, and `flex: 0 0 auto` stops it
   absorbing the spare height in a taller row. The body takes that up instead, which
   is where it belongs: the View Group row is pinned to the bottom with
   `margin-top: auto`, so it still lines up across a row of cards. */
.ota-flexi-listing .agend-flexi-search-result__image {
	position: relative;
	flex: 0 0 auto;
	height: 249px;

	/* The kiosk pulls this wrapper out by a negative gutter on all
	   four sides to escape a card padding the design does not have. With the card
	   flush, that only drags the picture outside its own corners. */
	margin: 0;

	/* A DELIBERATE EMPTY STATE, because most of these groups have no picture yet
	   and several may never get one. Flexi prints this wrapper whether or not
	   there is an image, so without a fill the slot is blank, the badge has
	   nothing to sit on and the card reads as broken rather than as text-only.
	   A tint of the card's own text colour keeps it inside whatever theme is
	   nested.

	   UNCONDITIONAL, AND NOT `:empty`. Measured on the rendered page: the wrapper
	   is printed with the template's indentation inside it, so it holds a
	   whitespace text node and `:empty` never matches. Painting it always and
	   letting the picture cover it needs no `:has()` and cannot be broken by the
	   kiosk template's whitespace changing. */
	background-color: color-mix( in srgb, var( --ota-text, #003038 ) 8%, transparent );
}

/* `!important` HERE IS NOT LAZINESS, IT IS THE ONLY THING THAT WINS.
   `iugo-membership-kiosk` ships
   `.agend-flexi-search-result__image img { width:100%!important; height:auto!important; aspect-ratio:330/190 }`.
   An important declaration can only be beaten by another important one, so
   specificity alone does nothing here. This selector carries one more class than
   theirs, so among the important declarations it wins.

   The forced 330/190 ratio is what left a strip of the empty-state tint under
   every photo: at roughly 350px wide that is a 201px picture in a 249px slot.
   `aspect-ratio: auto` hands the sizing back to the slot, which is what the frame
   does with `absolute inset-0 object-cover size-full`. */
.ota-flexi-listing .agend-flexi-search-result__image img {
	display: block;
	width: 100% !important;
	height: 100% !important;
	aspect-ratio: auto !important;
	object-fit: cover;
}

/* ---------------------------------------------------------------- the badge -- */

/* Ours, not `.agend-flexi-search-result__badge`. See templates/interest-groups/badge.php
   for why the kiosk's class is deliberately not reused. Shared by the groups'
   scope badge and the resources' type badge. */
.ota-flexi-listing .ota-listing-badge {
	position: absolute;

	/* spacing/24 from the top right of the image, per the frame: the badge's
	   container is `items-start justify-end` with 24px padding. */
	top: 24px;
	right: 24px;
	z-index: 1;

	margin: 0;
	padding: 6px 16px;

	background-color: var( --ota-cta-bg, #003038 );
	color: var( --ota-cta-text, #ffffff );

	font-family: inherit;
	font-size: 11.5px;
	font-weight: 700;
	line-height: 18.975px;
	letter-spacing: 0.69px;
	text-transform: capitalize;
	white-space: nowrap;

	border-radius: 999px;
}

/* THE KIOSK'S OWN BADGE, WHICH STARTED PRINTING ON 9 SEP 2026. The flexi card
   prints the post's primary `category` term in `.agend-flexi-search-result__badge`,
   at the top of the card body above the title. Until 9 Sep no post type on these
   listings carried `category`, so nothing printed; now resources and research
   items carry it as their interest group join (Content_Post_Type::
   register_shared_taxonomies()), and a card filed under a group shows the group
   there. That is wanted: it is the one place a card says which group it belongs
   to. What was not wanted was how it looked. The theme's skin
   (`skin-2020-*.css`) paints that class from its badge tokens, which on this
   site resolve to ochre on sand, 4px corners, uppercase, 12px regular: beside
   our navy pill on the image it read as a different component, and the client
   has a standing no-uppercase rule. Bryce, 9 Sep: "these badges need to match
   this style".

   So it takes the pill above, value for value, and stays where the kiosk puts it
   (the type is on the image, the group is above the title; putting both on the
   image would collide). Not absolute, and `margin-right: auto` kept from the
   kiosk so the body's flex column does not stretch it. The theme's rule is a
   bare class with no !important, so the one extra class here is enough. If the
   widget's own "Tag position" control is ever set to Absolute, the kiosk's
   `top: 10px` still applies and the two pills will fight; leave it on Default. */
.ota-flexi-listing .agend-flexi-search-result__badge {
	margin: 0 auto 12px 0;
	padding: 6px 16px;

	background-color: var( --ota-cta-bg, #003038 );
	color: var( --ota-cta-text, #ffffff );

	font-size: 11.5px;
	font-weight: 700;
	line-height: 18.975px;
	letter-spacing: 0.69px;
	text-transform: capitalize;
	white-space: nowrap;

	border-radius: 999px;
}

/* ----------------------------------------------------------------- the body -- */

.ota-flexi-listing .agend-flexi-search-result__body {
	display: flex;
	flex-direction: column;
	align-items: flex-start;

	/* THE BODY TAKES THE CARD'S SPARE HEIGHT, which is what puts the View Group row
	   on the bottom edge for every card rather than most of them. The card stretches
	   to its grid row, the picture is now a fixed 249px, so without this the body
	   ends at its own content height and the leftover space opens up underneath it:
	   the row then floats part way up any card in a tall row. Growing the body means
	   it always reaches the card's bottom, and `margin-top: auto` on the row does the
	   rest. */
	flex: 1 1 auto;

	/* spacing/24 all round, over the frame's fixed 212.75px of content. */
	min-height: 261px;
	padding: 24px;
	gap: 8px;
}

.ota-flexi-listing .agend-flexi-search-result__title {
	margin: 0;

	color: var( --ota-white-text, #003038 );

	font-size: 22px;
	font-weight: 700;
	line-height: 1.4;
}

.ota-flexi-listing .agend-flexi-search-result__excerpt {
	color: var( --ota-text, #003038 );

	/* Body/Small: NB International Pro Light 15/24.75. */
	font-size: 15px;
	font-weight: 300;
	line-height: 24.75px;
}

/* No date on the archive cards in the design: groups, resources and research are
   not dated content. The widget's "Show post date" switch is the primary lever and
   should be off; this is the guard, so those cards cannot grow a date if that
   setting is lost in a config migration. Archives only: on a page (`/news`) the
   date is the point of the card, so it stays, styled below. */
body.ota-flexi-listing .elementor-location-archive .agend-flexi-search-result__date {
	display: none;
}

/* The date on a page's cards, in the post card's meta style (ota-post-cards.css,
   `.elementor-post__meta-data`), so a news card here and a news card in a Posts
   grid elsewhere say the date the same way. */
.ota-flexi-listing .agend-flexi-search-result__date {
	margin: 0 0 8px;
	color: var( --ota-text-muted, #005361 );
	font-size: var( --e-global-typography-small-font-size, 15px );
	font-weight: var( --e-global-typography-small-font-weight, 300 );
	line-height: 1.4;
}

/* ------------------------------------------------------------- View Group -- */

/* TWO LINKS COME OUT OF THIS TEMPLATE AND ONLY ONE IS MEANT TO BE SEEN.
   `search-form.php` prints `__view_item_btn` only when "Show view item button" is
   on, and then prints `__link` unconditionally with a hardcoded "View". The
   kiosk styles that second one as an invisible stretched overlay:

     .agend-flexi-search-result__link { position:absolute; inset:0; font-size:0; color:transparent; opacity:0 }

   So `__link` is what makes the whole card clickable, and it is deliberately
   invisible. An earlier pass of this file styled it as the visible row, which is
   why no button appeared: the rules applied to an element with `opacity: 0`.
   Nothing below targets it.

   `__view_item_btn` also arrives carrying `btn btn-primary`, so Bootstrap hands it
   a #007bff fill and a 1px border. Every declaration below that undoes those is
   at (0,2,0) against Bootstrap's (0,1,0), and no higher-specificity `.btn` rule on
   this site applies without an `.input-group` or `.btn-group` ancestor.

   The frame's row: label at one end, a round arrow at the other, 48px tall, full
   width, pinned to the bottom of the body. `margin-top: auto` is what holds the
   row on the baseline across a row of cards whose descriptions differ in length. */
/* THE SELECTOR IS THIS LONG ON PURPOSE. Bootstrap's `.btn-primary` at (0,1,0) was
   never the real competitor. The theme ships `html body .btn.btn-primary` at
   (0,2,2), which beat the (0,2,0) this rule used to carry and rendered the design's
   bare row as the theme's standard filled button with a centred label. Adding the
   card class and the `body` element takes this to (0,3,1), which wins on b.

   Two of the theme's declarations are `!important`, `border-radius` and
   `font-size`, so those two have to be marked here as well. The rest do not, and
   are deliberately left plain so this stays as weak as it can be. */
body.ota-flexi-listing .agend-flexi-search-result .agend-flexi-search-result__view_item_btn {
	/* Anchors the arrow, which is absolutely positioned over the circle. */
	position: relative;

	display: flex;
	align-items: center;

	/* The theme's button centres its label. The frame puts the label at one end and
	   the arrow at the other. */
	justify-content: space-between;
	width: 100%;
	min-height: 48px;
	margin-top: auto;
	padding: 0;

	/* Both, deliberately. The shorthand resets the longhand and would be enough,
	   but `.btn-primary` sets `background-color: #007bff` as a longhand, and one
	   explicit line is cheaper than trusting everyone who reads this to expand the
	   shorthand in their head. */
	background: none;
	background-color: transparent;

	color: var( --ota-text, #003038 );
	font-size: 17px !important;
	font-weight: 700;
	line-height: 17px;

	/* The theme's buttons are uppercased on this site; "View Group" is not. */
	text-transform: none;
	text-decoration: none;

	/* Transparent 1.5px in the frame, so the row does not move when a focus or
	   hover state gives it a visible one. */
	border: 1.5px solid transparent;
	border-radius: 999px !important;
}

/* THE ARROW IS DRAWN HERE, NOT BY THE WIDGET'S "Arrow after" BUTTON STYLE. That
   style writes `content: "→"` with `margin-left: 0.25em` from Elementor's own
   inline CSS at three classes of specificity, which parks the glyph against the
   label instead of at the far end of the row and cannot be overridden from a
   stylesheet at two. Leaving Button style on Default keeps one owner for it. */
/* THE DOT AND THE ARROW HAVE TO BE TWO LAYERS. A `mask` clips everything the
   element paints, its background included, so one masked pseudo-element cannot be
   both the filled circle and the arrow cut out of it. `::before` is the circle and
   `::after` is the arrow laid over it.

   An earlier pass used the "\2192" text glyph for the arrow, which was the wrong
   shape. It is now `assets/img/ota-btn-arrow.svg`, masked rather than used as an
   image so the paint comes from a role and follows the colour theme in both states.

   THAT IS THE SAME ARROW THE DESIGN SUPPLIES, so there is no second asset to add
   and no reason to add one later. The card component ships it normalised to a 30x30
   box with a 1.35417 stroke and a 7.583 shaft; `ota-btn-arrow.svg` is normalised to
   24x24 with a 2.5 stroke and a 14 shaft. Scaled into the 13px box below they are
   the same drawing: 2.5 * 13/24 = 1.354 and 14 * 13/24 = 7.583, and the chevron
   lands on the same coordinates. Checked rather than assumed, because the two files
   look nothing alike side by side.

   `order: 1` is what puts the circle after the label. A pseudo-element is a flex
   item, and `::before` would otherwise sit in front of it: the label is a bare text
   node, so it becomes an anonymous flex item at the default order of 0. */
body.ota-flexi-listing .agend-flexi-search-result .agend-flexi-search-result__view_item_btn::before {
	content: "";
	order: 1;
	flex: 0 0 auto;
	width: 30px;
	height: 30px;

	/* `bar/background` in the resting variant, the same role as the card behind it,
	   so the circle is invisible until hover and the row reads as a bare arrow. */
	background-color: var( --ota-background, #ffffff );
	border-radius: 15px;

	/* Not in the design, which draws two static variants. A colour-only transition
	   at this length reads as finished rather than animated, and there is no
	   movement in it for `prefers-reduced-motion` to object to. */
	transition: background-color 150ms ease;
}

/* The arrow, centred on the circle. `justify-content: space-between` leaves the
   circle at the row's right edge, so 8.5px of inset from that edge centres a 13px
   glyph in a 30px dot. */
body.ota-flexi-listing .agend-flexi-search-result .agend-flexi-search-result__view_item_btn::after {
	content: "";
	position: absolute;
	top: 50%;
	right: 8.5px;
	transform: translateY( -50% );

	/* 13px inside the 30px circle, which is the frame's own `p-[8.5px]`:
	   (30 - 13) / 2 = 8.5. */
	width: 13px;
	height: 13px;

	background-color: var( --ota-text, #003038 );

	-webkit-mask: url( "../img/ota-btn-arrow.svg" ) no-repeat center / contain;
	mask: url( "../img/ota-btn-arrow.svg" ) no-repeat center / contain;

	transition: background-color 150ms ease;
}

/* ------------------------------------------------------------ hover state -- */

/* Figma: `component/interest cards`, variant `Property 1=Variant2`, 377:22511,
   against `Property 1=Default` 307:21980. Three changes and nothing else. */

/* 1. The card takes a 2px border in `bar/text`.

   DRAWN AS A PSEUDO-ELEMENT OVERLAY, and the two obvious alternatives both fail:

   A real `border` would pull the content in by 2px under the cursor and jitter the
   grid, because the default variant has no border to reserve space for. Reserving
   a transparent one instead insets the picture by 2px in the resting state, and the
   card is meant to be flush.

   An `outline` was the first attempt here and is wrong. An outline is painted with
   the element's own decoration, and descendants paint on top of it, so the picture
   covered the top half of the ring and the frame only appeared around the body.

   An absolutely positioned `::after` is a later-painted child, so it sits above the
   image, costs no layout, and follows the card's radius. `pointer-events: none`
   keeps it from swallowing the link underneath. The card is already
   `position: relative` for the badge, which is what this anchors to. */
.ota-flexi-listing .agend-flexi-search-result::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 2;

	border: 2px solid transparent;
	border-radius: 14px;
	pointer-events: none;

	transition: border-color 150ms ease;
}

.ota-flexi-listing .agend-flexi-search-result:hover::after {
	border-color: var( --ota-text, #003038 );
}

/* KEYBOARD FOCUS GETS THE SAME FRAME, and here that is a fix rather than a nicety.
   The thing that receives focus on this card is `__link`, the stretched overlay,
   which the kiosk renders at `opacity: 0`. So without this a keyboard
   user tabbing through the grid gets no visible indication of which card they are
   on at all (WCAG 2.4.7). The frame is the only affordance the design gives, so it
   does double duty.

   Not folded into the `:hover` selector above: an invalid `:focus-within` in a
   comma list would take the hover rule down with it in older engines, and the two
   are worth reading separately anyway. */
.ota-flexi-listing .agend-flexi-search-result:focus-within::after {
	border-color: var( --ota-text, #003038 );
}

/* 2. The label and the title underline. `from-font` on both thickness and position
   is what the variant specifies, so the underline sits where NB International Pro
   says rather than where the browser guesses.

   THE TITLE IS NOT UNDERLINED IN THE FIGMA VARIANT. Variant2 377:22511 applies the
   underline to the "View Group" label only; the title carries the same classes in
   both states. Asked for by Bryce on 19 Aug 2026, so the build is deliberately
   ahead of the frame here and the variant wants updating to match. */
body.ota-flexi-listing .agend-flexi-search-result:hover .agend-flexi-search-result__title,
body.ota-flexi-listing .agend-flexi-search-result:hover .agend-flexi-search-result__view_item_btn {
	text-decoration-line: underline;
	text-decoration-style: solid;
	text-decoration-thickness: from-font;
	text-underline-position: from-font;
}

/* 3. The dot fills with `cta-bg` and the arrow flips to `active-text`. Under the
   white theme the cards nest, those resolve to #003038 and #F0E7D8, which is
   exactly what the variant draws. Two rules because they are two layers: the
   circle is `::before` and the arrow laid over it is `::after`. */
body.ota-flexi-listing .agend-flexi-search-result:hover .agend-flexi-search-result__view_item_btn::before {
	background-color: var( --ota-cta-bg, #003038 );
}

body.ota-flexi-listing .agend-flexi-search-result:hover .agend-flexi-search-result__view_item_btn::after {
	background-color: var( --ota-active-text, #f0e7d8 );
}

/* Keyboard focus has to be visible on the one interactive thing in each card.
   The theme's own focus styles do not reach this element, and the row is laid out
   above rather than restyled, so nothing else supplies one. */
body.ota-flexi-listing .agend-flexi-search-result .agend-flexi-search-result__view_item_btn:focus-visible {
	outline: 2px solid var( --ota-text, #003038 );

	/* Inside the box: the card is `overflow: clip` and the row spans its full
	   width, so a ring drawn outside would be cut off at both ends. Same reason
	   the Elementor widgets file gives for the accordion title. */
	outline-offset: -2px;
}

/* -------------------------------------------------------------- narrower -- */

/* The widget's Columns control is set to 3/2/1 and writes `--columns` at each
   breakpoint in `uploads/elementor/css/post-2297.css`, so these fallbacks only
   decide for a widget saved before that control was touched. They step down in the
   same order so an unconfigured instance never lands on three columns on a
   phone. */
@media ( max-width: 1024px ) {
	.ota-flexi-listing .agend-flexi-search-results__posts {
		grid-template-columns: repeat( var( --columns, 2 ), minmax( 0, 1fr ) );
	}
}

@media ( max-width: 767px ) {
	.ota-flexi-listing .agend-flexi-search-results__posts {
		grid-template-columns: repeat( var( --columns, 1 ), minmax( 0, 1fr ) );
	}

	.ota-flexi-listing .agend-flexi-search-result__body {
		min-height: 0;
	}

	.ota-flexi-listing .agend-flexi-search-result__image {
		height: 200px;
	}
}

/* -------------------------------------------------------------- the filters -- */

/* THE RESOURCES LISTING HAS DROPDOWN FILTERS, THE GROUPS LISTING HAS NONE, so
   nothing above touches these. The kiosk lays the filters out as a wrapping flex
   row padded by its `--gutter` and hides the labels, leaving each select with the
   browser's own chrome. They are redrawn here as the search field's pills: same
   height, radius and type, white on the ash section, sitting centred under the
   field on the same 780px measure. `appearance: none` drops the native arrow so
   the chevron can be drawn in the text colour role. */
.ota-flexi-listing .agend-flexi-search-form__filters {
	width: 100%;
	max-width: 780px;
	margin: 16px auto 0;
	padding: 0;
	justify-content: center;
	gap: 16px;
}

.ota-flexi-listing .agend-flexi-search-form__filter {
	position: relative;
	flex: 1 1 240px;
	min-width: 0;
}

/* The kiosk products extension's 2020 skin (`skin-2020-*.css`) draws its own
   chevron as a `::after` on this wrapper, on top of the select. With ours on
   the select itself that made two arrows, so the skin's goes. */
.ota-flexi-listing .agend-flexi-search-form__filter::after {
	display: none;
}

.ota-flexi-listing .agend-flexi-search-form__filter-options {
	width: 100%;
	min-height: 50px;
	margin: 0;
	padding: 0 48px 0 24px;

	background-color: #ffffff;
	background-image: url( "data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'><path d='M3 6l5 5 5-5' fill='none' stroke='%23003038' stroke-width='1.5'/></svg>" );
	background-repeat: no-repeat;
	background-position: right 17px center;
	border: 0;
	border-radius: 24px;
	box-shadow: none;

	color: var( --ota-text, #003038 );
	/* The 2020 skin sets a display face, uppercase, a 10.375rem cap and an
	   ellipsis on this select, undone per instance by the widget's own
	   generated classes, which a hand-built listing does not get. Named here so
	   the control reads as one of ours: body face, sentence case, and free to
	   fill the filter row rather than truncating a term name mid-word. */
	font-family: inherit;
	font-size: 15px;
	font-weight: 300;
	line-height: 24.75px;
	text-transform: none;
	text-overflow: clip;
	max-width: none;

	-webkit-appearance: none;
	appearance: none;
	cursor: pointer;
}

.ota-flexi-listing .agend-flexi-search-form__filter-options:focus-visible {
	outline: 2px solid var( --ota-text, #003038 );
	outline-offset: -4px;
}
