/* ===========================================================================
   Article listing page, design canvas "QMS - Ressurser - Artikler" (2026-11-11)
   ===========================================================================
   Loaded only on pages whose content has the `cq-artlist-loop` query (see
   inc/page-artikler.php): /no/artikler/ and /articles/. The cards are the
   shared resource cards (style.css `.cq-loop .cq-card`).

   - Filter band on white under the hero: search field and category list,
     and "Nullstill" / "Reset" while a filter is active (the count line is
     for screen readers only). Built by
     assets/js/page-artikler.js; hidden until the script has run.
   - List band on panel grey: three rows of three cards, then
     "Vis flere artikler" (Oda, 2026-11-11: no wide first card).
   - "Mer fra Ressurser": the news page's tiles (page-nyheter.css).
   Breakpoints as on the other canvas pages: tablet below 1024px, phone below 600px. */

.cq-main {
	--cq-ar-ease: cubic-bezier(.2, 0, 0, 1);
}

/* --- Filter band ---------------------------------------------------------- */

/* Nothing to show until the script has built the controls. */
.cq-artfilter:not(.is-ready) {
	display: none;
}

.wp-block-post-content > .cq-band--white.cq-artfilter {
	padding-block: 32px 28px;
}

.cq-artfilter__ui {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.cq-artfilter__row {
	align-items: end;
	display: grid;
	gap: 24px;
	grid-template-columns: minmax(0, 1fr) 340px;
}

.cq-artfilter__field {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin: 0;
}

.cq-artfilter__label {
	color: var(--cq-navy);
	font-size: 13px;
	font-weight: 600;
	letter-spacing: .08em;
	line-height: 1.2;
	margin: 0;
	text-transform: uppercase;
}

.cq-artfilter__sr {
	clip: rect(0 0 0 0);
	height: 1px;
	overflow: hidden;
	position: absolute;
	white-space: nowrap;
	width: 1px;
}

.cq-artfilter__search,
.cq-artfilter__btn {
	align-items: center;
	background: #ffffff;
	border: 1px solid #727272;
	border-radius: var(--cq-radius-sm);
	box-sizing: border-box;
	display: flex;
	gap: 12px;
	min-height: 52px;
	padding: 0 16px;
	transition: border-color 120ms var(--cq-ar-ease), box-shadow 120ms var(--cq-ar-ease);
}

.cq-artfilter__search {
	color: #3f4947;
}

.cq-artfilter__search:focus-within {
	border-color: var(--cq-blue);
	box-shadow: 0 0 0 2px var(--cq-blue);
}

.cq-artfilter__search svg,
.cq-artfilter__btn svg,
.cq-artfilter__opt svg {
	flex: none;
}

.cq-artfilter__input {
	appearance: none;
	background: transparent;
	border: 0;
	color: #232323;
	flex: 1;
	font-family: inherit;
	font-size: 16px;
	font-weight: 400;
	line-height: 1.3;
	min-height: 50px;
	min-width: 0;
	outline: none;
	padding: 0;
}

/* The theme's form field look (border, radius) sits on the box, not the field.
   style.css sets it with !important on `.cq-main input:not(…)`, hence the weight here. */
.cq-main .cq-artfilter .cq-artfilter__search input.cq-artfilter__input[type="search"] {
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none;
	padding: 0;
}

.cq-artfilter__input::placeholder {
	color: #3f4947;
	opacity: 1;
}

/* Category list: a button that opens a list of options. */
.cq-artfilter__dd {
	position: relative;
}

.cq-artfilter__btn {
	color: var(--cq-ink);
	cursor: pointer;
	font-family: inherit;
	font-size: 16px;
	font-weight: 500;
	line-height: 1.2;
	justify-content: space-between;
	text-align: left;
	width: 100%;
}

.cq-artfilter__btn:hover {
	border-color: #3f4947;
}

.cq-artfilter__btn:focus-visible {
	outline: 2px solid var(--cq-blue);
	outline-offset: 2px;
}

.cq-artfilter__value {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.cq-artfilter__chev {
	transition: transform 200ms var(--cq-ar-ease);
}

.cq-artfilter__btn[aria-expanded="true"] .cq-artfilter__chev {
	transform: rotate(180deg);
}

.cq-artfilter__list {
	background: #ffffff;
	border: 1px solid var(--cq-border);
	border-radius: var(--cq-radius-md);
	box-shadow: var(--cq-shadow-md);
	display: flex;
	flex-direction: column;
	gap: 2px;
	left: 0;
	list-style: none;
	margin: 0;
	max-height: min(420px, 60vh);
	overflow-y: auto;
	padding: 6px;
	position: absolute;
	right: 0;
	top: calc(100% + 8px);
	z-index: 60;
}

.cq-artfilter__list[hidden] {
	display: none;
}

.cq-artfilter__list > li {
	margin: 0;
}

.cq-artfilter__opt {
	align-items: center;
	background: none;
	border: 0;
	border-radius: var(--cq-radius-sm);
	color: #3f4947;
	cursor: pointer;
	display: flex;
	font-family: inherit;
	font-size: 16px;
	font-weight: 400;
	line-height: 1.3;
	gap: 12px;
	justify-content: space-between;
	min-height: 48px;
	padding: 0 16px;
	text-align: left;
	transition: background-color 120ms var(--cq-ar-ease), color 120ms var(--cq-ar-ease);
	width: 100%;
}

.cq-artfilter__opt:hover {
	background: var(--cq-mist);
	color: var(--cq-ink);
}

.cq-artfilter__opt:focus-visible {
	outline: 2px solid var(--cq-blue);
	outline-offset: -2px;
}

.cq-artfilter__opt[aria-pressed="true"] {
	background: var(--cq-mist);
	color: var(--cq-ink);
	font-weight: 500;
}

.cq-artfilter__opt svg {
	color: var(--cq-blue);
	visibility: hidden;
}

.cq-artfilter__opt[aria-pressed="true"] svg {
	visibility: visible;
}

.cq-artfilter__foot {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: 4px 16px;
	min-height: 44px;
}

.cq-artfilter__reset,
.cq-artempty__reset {
	background: none;
	border: 0;
	color: var(--cq-blue);
	cursor: pointer;
	font-family: inherit;
	font-size: 15px;
	font-weight: 500;
	line-height: 1;
	min-height: 44px;
	padding: 0 4px;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.cq-artfilter__reset:hover {
	color: var(--cq-navy);
}

.cq-artfilter__foot[hidden] {
	display: none;
}

.cq-artfilter__reset:focus-visible {
	outline: 2px solid var(--cq-blue);
	outline-offset: 2px;
}

/* --- List band -------------------------------------------------------------- */

.wp-block-post-content > .cq-band--panel.cq-artlist {
	padding-block: clamp(40px, 5vw, 64px) clamp(64px, 8vw, 96px);
}

/* Cards outside the current batch or filter (set by the script). */
.cq-artlist .cq-loop .wp-block-post-template > li[hidden],
.cq-artlist [hidden] {
	display: none !important;
}

/* No results (made by the script). */
.cq-artempty {
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding-block: 16px 32px;
}

.cq-artempty__title {
	color: var(--cq-ink);
	font-size: 22px;
	font-weight: 500;
	line-height: 1.3;
	margin: 0;
}

.cq-artempty__body {
	color: #3f4947;
	font-size: 16px;
	line-height: 1.5;
	margin: 0 0 8px;
}

/* "Vis flere artikler" and the end note (made by the script). */
.cq-artmore {
	align-items: center;
	display: flex;
	flex-direction: column;
	gap: 16px;
	margin-block-start: 48px !important;
}

.cq-artmore__btn,
.cq-artempty__btn {
	align-self: center;
	background: #ffffff;
	border: 1px solid var(--cq-ink);
	border-radius: var(--cq-radius-pill);
	color: var(--cq-ink);
	cursor: pointer;
	font-family: inherit;
	font-size: 16px;
	font-weight: 500;
	line-height: 1;
	min-height: 52px;
	padding: 0 28px;
	transition: background-color 120ms var(--cq-ar-ease), color 120ms var(--cq-ar-ease);
}

.cq-artempty__btn {
	align-self: flex-start;
}

.cq-artmore__btn:hover,
.cq-artempty__btn:hover {
	background: var(--cq-ink);
	color: #ffffff;
}

.cq-artmore__btn:focus-visible,
.cq-artempty__btn:focus-visible {
	outline: 2px solid var(--cq-blue);
	outline-offset: 2px;
}

.cq-artmore__note {
	color: #3f4947;
	font-size: 15px;
	line-height: 1.5;
	margin: 0;
}

/* --- Tablet and phone ------------------------------------------------------- */

@media (max-width: 767.98px) {
	.cq-artfilter__row {
		gap: 20px;
		grid-template-columns: minmax(0, 1fr);
	}

	.wp-block-post-content > .cq-band--white.cq-artfilter {
		padding-block-start: 24px;
	}
}

@media (max-width: 599.98px) {
	.cq-artmore__btn,
	.cq-artempty__btn {
		width: 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.cq-artfilter__search,
	.cq-artfilter__btn,
	.cq-artfilter__chev,
	.cq-artfilter__opt,
	.cq-artmore__btn,
	.cq-artempty__btn {
		transition: none;
	}
}
