/******************************************************************

Stylesheet: Gutenberg-blokker

Styling av WordPress-blokker som temaets Foundation-oppsett ikke
dekker. Ligger som ren CSS fordi gulp/node-sass-oppsettet i temaet
ikke lenger bygger på moderne Node. Lastes etter style.css.

******************************************************************/

/* --- Fil-blokk (dokumenter til nedlasting) ------------------------ */

.entry-content .wp-block-file {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	/* Rammelinje over og under; -1px topp-margin lar linjene i en liste overlappe */
	margin: -1px 0 0;
	margin-block-start: -1px;
	padding: 0.6rem 0;
	border-top: 1px solid #e6e6e6;
	border-bottom: 1px solid #e6e6e6;
	font-size: 1rem;
	line-height: 1.4;
}

/* Litt luft mellom tekst og første fil i en liste */
.entry-content :not(.wp-block-file) + .wp-block-file {
	margin-block-start: 0.5rem;
}

/* Redaktøren har pakket enkelte fil-blokker inn i en Gruppe-blokk med
   flex-layout. Behandle den som en vanlig rad i listen. */
.entry-content .wp-block-group:has(> .wp-block-file) {
	display: block;
	padding: 0;
}
.entry-content .wp-block-file + .wp-block-group:has(> .wp-block-file),
.entry-content .wp-block-group:has(> .wp-block-file) + .wp-block-file {
	margin-block-start: -1px;
}
.entry-content .wp-block-group:has(> .wp-block-file) > .wp-block-file + .wp-block-file {
	margin-block-start: -1px;
}

/* Filnavnet */
.entry-content .wp-block-file > a:not(.wp-block-file__button) {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	align-items: center;
	gap: 0.6rem;
	color: #0a0a0a;
	font-weight: 500;
	text-decoration: none;
	overflow-wrap: anywhere;
}
.entry-content .wp-block-file > a:not(.wp-block-file__button):hover {
	color: #d60000;
}
.entry-content .wp-block-file > a:not(.wp-block-file__button)::before {
	content: "";
	flex: 0 0 auto;
	width: 1.1rem;
	height: 1.1rem;
	background-color: #d60000;
	-webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/><polyline points='14 2 14 8 20 8'/></svg>") no-repeat center / contain;
	mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/><polyline points='14 2 14 8 20 8'/></svg>") no-repeat center / contain;
}

/* "Last ned"-knappen */
.entry-content .wp-block-file .wp-block-file__button {
	flex: 0 0 auto;
	margin: 0;
	padding: 0.35rem 0.9rem;
	border: 1px solid #d60000;
	border-radius: 999px;
	background: transparent;
	color: #d60000;
	font-size: 0.8rem;
	font-weight: 500;
	line-height: 1.2;
	text-decoration: none;
	white-space: nowrap;
	transition: background-color 0.2s ease-out, color 0.2s ease-out;
}
.entry-content .wp-block-file .wp-block-file__button:hover,
.entry-content .wp-block-file .wp-block-file__button:focus {
	background: #d60000;
	color: #fff;
}
/* Fallback-tekst hvis redaktøren har slettet knappeteksten */
.entry-content .wp-block-file .wp-block-file__button:empty::before {
	content: "Last ned";
}

/* Smale kolonner og mobil: filnavn over knappen */
@media screen and (max-width: 39.9375em) {
	.entry-content .wp-block-file {
		flex-wrap: wrap;
		gap: 0.4rem 1rem;
	}
	.entry-content .wp-block-file .wp-block-file__button {
		margin-left: 1.7rem;
	}
}

/* --- Tomme blokker fra editoren --------------------------------- */

.entry-content p:empty,
.entry-content li:empty,
.entry-content ul:not(:has(li:not(:empty))) {
	display: none;
}
