/* ==========================================================================
   1. FUNCTIONAL
   What the blocks need to work: layout, the icons, the buttons that open
   hidden text, the language switch of written statements, and the editor
   preview. Changing these can break the blocks.
   ========================================================================== */

/* The list */
.mep-feed__list {
	box-sizing: border-box;
	list-style: none;
	padding: 0;
	margin: 0;
	position: relative;
}

.mep-feed__date {
	display: block;
}

/* Title (an h3), with the arrow in front of it. The margin reset keeps the
   theme's own heading margins from spacing the entries apart. */
.mep-feed__title {
	display: block;
	position: relative;
}
.mep-feed__list .mep-feed__title {
	margin: 2px 0 3px 0;
}

.mep-feed__title:before {
	content: "";
	position: absolute;
	left: -22px;
	width: 13px;
	aspect-ratio: 87 / 66;
	line-height: 1;
	margin: 0;
	transition: transform 0.3s ease, background-color 0.3s ease;
	-webkit-mask: url("./icons/arrow.svg") center / contain no-repeat;
	mask: url("./icons/arrow.svg") center / contain no-repeat;
}

.mep-feed__title:hover::before {
	transform: translateX(2px);
}

/* Buttons */
.mep-feed__button {
	display: inline-block;
}

a.mep-feed__button:link,
a.mep-feed__button:visited,
button.mep-feed__button {
	transition: all 0.3s;
}

button.mep-feed__button {
	cursor: pointer;
	font: inherit;
}

/* Hidden text: written statements (MEP Plenary Events) and descriptions
   (MEP Feed) stay closed until their button is clicked; entries past the
   first ones wait behind the "Show all" button, and the topic filter hides
   the entries that don't match */
.mep-feed__item[hidden],
.mep-feed__more[hidden],
.mep-feed__statement[hidden],
.mep-feed__statement-text[hidden],
.mep-feed__bodytext[hidden] {
	display: none;
}

/* Language switch of a written statement: plain text buttons */
button.mep-feed__statement-version {
	background: none;
	border: 0;
	padding: 0;
	font: inherit;
	cursor: pointer;
	text-transform: uppercase;
}

button.mep-feed__statement-version.is-active {
	cursor: default;
}

/* Icons: SVG masks from icons/, filled with currentColor so each icon
   takes the text color of the button it sits in. */

/* External link: after any link that opens in a new tab */
a.mep-feed__button[target=_blank]::after {
	content: "";
	display: inline-block;
	width: 0.8em;
	aspect-ratio: 1;
	margin: 0 0 0 4px;
	vertical-align: middle;
	position: relative;
	top: -0.1em;
	background-color: currentColor;
	-webkit-mask: url("./icons/ext.svg") center / contain no-repeat;
	mask: url("./icons/ext.svg") center / contain no-repeat;
}

/* Drop-down: after any button that opens hidden text (aria-controls) */
button.mep-feed__button[aria-controls]::after {
	content: "";
	display: inline-block;
	width: 0.8em;
	aspect-ratio: 94 / 47;
	margin: 0 0 0 4px;
	vertical-align: middle;
	position: relative;
	top: -0.1em;
	background-color: currentColor;
	-webkit-mask: url("./icons/drop.svg") center / contain no-repeat;
	mask: url("./icons/drop.svg") center / contain no-repeat;
	transition: transform 0.3s ease;
}

/* Flipped to point up while its hidden text is open */
button.mep-feed__button[aria-expanded="true"]::after {
	transform: rotate(180deg);
}

@media (prefers-reduced-motion: reduce) {
	button.mep-feed__button[aria-controls]::after {
		transition: none;
	}
}

p.mep-feed__source {
	position: absolute;
	right: 0;
	bottom: -15px;
	transform: translateY(100%);
}

/* Block editor: a click on the list selects the block instead of
   following a link */
.editor-styles-wrapper .mep-feed__list {
	position: relative;
}

.editor-styles-wrapper .mep-feed__list:after {
	position: absolute;
	content: "";
	width: 100%;
	height: 100%;
	display: block;
	top: 0;
	left: 0;
	z-index: 10;
}