/*
Theme Name: StrawTech
Theme URI: https://www.strawtech.dk
Author: Maibritt Rittermann
Description: Selvstændigt blok-tema til StrawTech ApS. Farver, fonte og layout styres fra theme.json. Ingen JavaScript fra temaet.
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 8.1
Version: 0.1.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: strawtech
*/

/* Det meste af designet ligger i theme.json. Her kun det, theme.json ikke kan udtrykke. */

/* Synligt fokus for tastaturbrugere */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: 3px solid var(--wp--preset--color--orange);
	outline-offset: 3px;
}

/* Overskrifter må ikke knække midt i lange danske sammensatte ord på mobil */
h1, h2, h3 {
	overflow-wrap: break-word;
	hyphens: auto;
}

/* ---------- Header ---------- */

.st-brand .wp-block-site-logo img {
	max-width: min(100%, 55vw);
	height: auto;
}

/* "Kontakt os"-knappen i headeren skjules på små skærme, hvor den står i mobilmenuen i stedet.
   Skal vægte højere end WordPress' .wp-block-buttons.is-layout-flex { display: flex }. */
@media (max-width: 781px) {
	header .wp-block-buttons.st-header-knap {
		display: none !important;
	}
}
.wp-block-navigation .st-kun-mobil {
	display: none;
}
.wp-block-navigation__responsive-container.is-menu-open .st-kun-mobil {
	display: flex;
}
.wp-block-navigation__responsive-container.is-menu-open .st-kun-mobil .wp-block-navigation-item__content {
	margin-top: 0.5rem;
	padding: 0.7rem 1.4rem !important;
	background: var(--wp--preset--color--oliven);
	color: var(--wp--preset--color--base) !important;
	border-radius: 999px;
}

/* Mobilmenu: venstrestillet og med god luft mellem punkterne */
.wp-block-navigation__responsive-container.is-menu-open {
	--navigation-layout-justification-setting: flex-start;
	--navigation-layout-justify: flex-start;
	text-align: left;
}
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content,
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container,
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item,
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container {
	align-items: flex-start !important;
	justify-content: flex-start !important;
	text-align: left;
}
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
	font-size: 1.125rem;
	padding-block: 0.35rem;
}

/* ---------- Hero ---------- */

/* På smalle skærme står teksten over hele billedet, så overlayet gøres jævnt mørkt */
@media (max-width: 781px) {
	.st-hero .wp-block-cover__background {
		background: rgba(32, 46, 26, 0.72) !important;
	}
}

/* ---------- Ikonrække ---------- */

.st-ikoner {
	text-align: center;
}
.st-ikoner .wp-block-image {
	margin-bottom: 0.5rem;
}
.st-ikoner .wp-block-image img {
	width: 56px;
	height: 56px;
}
.st-ikoner p {
	font-family: var(--wp--preset--font-family--poppins);
	font-weight: 500;
	font-size: 0.9375rem;
	line-height: 1.35;
	color: var(--wp--preset--color--skov);
}

/* ---------- Kort ---------- */

.st-kort {
	height: 100%;
	border-radius: 14px;
	overflow: hidden;
}
.st-kort .wp-block-image,
.st-kort .wp-block-post-featured-image {
	margin: 0;
}
.st-kort .wp-block-image img,
.st-kort .wp-block-post-featured-image img {
	border-radius: 0;
}
.st-afrundet img,
.st-afrundet.wp-block-video video,
.st-afrundet .wp-block-cover__image-background {
	border-radius: 16px;
}
.wp-block-cover.st-afrundet {
	border-radius: 16px;
	overflow: hidden;
}

/* ---------- Film ---------- */

.st-film video {
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	background: var(--wp--preset--color--skov);
	border-radius: 16px;
}

/* ---------- Footer ---------- */

.st-footer a {
	text-decoration: none;
}
.st-footer a:hover {
	text-decoration: underline;
}
.st-liste-uden-punkter {
	list-style: none;
	padding-left: 0;
}
.st-liste-uden-punkter li + li {
	margin-top: 0.4rem;
}

/* ---------- Vores proces (Sugerør) ---------- */

.st-proces {
	counter-reset: st-trin;
	list-style: none;
	padding: 0;
	margin: 0;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
	gap: var(--wp--preset--spacing--30);
}
.st-proces > .wp-block-group {
	position: relative;
	text-align: center;
}
.st-proces img {
	width: 56px;
	height: 56px;
}
.st-proces p {
	margin-top: 0.4rem;
	font-family: var(--wp--preset--font-family--poppins);
	font-weight: 500;
	font-size: 0.9375rem;
	color: var(--wp--preset--color--skov);
}
/* Pil mellem trinene på store skærme */
@media (min-width: 782px) {
	.st-proces > .wp-block-group:not(:last-child)::after {
		content: "→";
		position: absolute;
		right: calc(-0.5 * var(--wp--preset--spacing--30) - 0.4em);
		top: 18px;
		color: var(--wp--preset--color--oliven);
		font-size: 1.25rem;
	}
}

/* ---------- Kemi-boks (Dyrkningsvejledning) ---------- */

.st-kemi summary {
	font-family: var(--wp--preset--font-family--poppins);
	font-weight: 600;
	font-size: var(--wp--preset--font-size--large);
	color: var(--wp--preset--color--skov);
	cursor: pointer;
	padding-block: 0.25rem;
}
.st-kemi .wp-block-table td,
.st-kemi .wp-block-table th {
	border: 0;
	border-bottom: 1px solid rgba(32, 46, 26, 0.15);
	padding: 0.55rem 0.75rem 0.55rem 0;
	text-align: left;
}
.st-kemi .wp-block-table tr:last-child td {
	border-bottom: 0;
}

/* ---------- Logorække (Projekter) ----------
   Rækken glider langsomt frem og tilbage, hvis logoerne ikke kan være der på én gang.
   Ingen JavaScript. Står stille ved hover og for besøgende, der har slået animationer fra. */

.st-logoer {
	container-type: inline-size;
	overflow: hidden;
}
.st-logoer > .wp-block-group {
	width: max-content;
	flex-wrap: nowrap !important;
	animation: st-panorer 24s ease-in-out infinite alternate;
}
.st-logoer:hover > .wp-block-group,
.st-logoer:focus-within > .wp-block-group {
	animation-play-state: paused;
}
.st-logoer img {
	height: 64px;
	width: auto;
	max-width: 200px;
	object-fit: contain;
}
@keyframes st-panorer {
	from { transform: translateX(0); }
	to { transform: translateX(min(0px, calc(100cqw - 100%))); }
}
@media (prefers-reduced-motion: reduce) {
	.st-logoer {
		overflow-x: auto;
	}
	.st-logoer > .wp-block-group {
		animation: none;
	}
}

/* ---------- Vidensportal ---------- */

/* Filterknapper: kategorilisten vises som knapper */
.st-filter {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
	align-items: center;
}
.st-filter > p {
	margin: 0;
}
.st-filter ul.wp-block-categories {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
	list-style: none;
	padding: 0;
	margin: 0;
}
.st-filter a {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	box-sizing: border-box;
	padding: 0.55rem 1.1rem;
	border: 1.5px solid var(--wp--preset--color--oliven);
	border-radius: 999px;
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--skov);
	font-family: var(--wp--preset--font-family--poppins);
	font-weight: 600;
	font-size: 0.9375rem;
	text-decoration: none;
}
.st-filter a:hover,
.st-filter .current-cat > a,
.st-filter .st-aktiv a {
	background: var(--wp--preset--color--oliven);
	color: var(--wp--preset--color--base);
}

/* Kategorien på kort vises som et lille mærke */
.st-maerke a {
	display: inline-block;
	padding: 0.15rem 0.65rem;
	border-radius: 999px;
	background: var(--wp--preset--color--lys-oliven);
	color: var(--wp--preset--color--skov);
	text-decoration: none;
}
.st-maerke .wp-block-post-terms__separator {
	display: none;
}

/* Kort i Vidensportalen */
.st-indlaeg {
	height: 100%;
	border: 1px solid #E4DFCF;
	border-radius: 14px;
	overflow: hidden;
	background: var(--wp--preset--color--base);
}
.st-indlaeg .wp-block-post-featured-image {
	margin: 0;
}

/* Downloads med ikon */
.st-downloads li {
	padding: 0.6rem 0;
	border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}
.st-downloads li:last-child {
	border-bottom: 0;
}
.st-downloads a {
	text-decoration: none;
}
.st-downloads a:hover {
	text-decoration: underline;
}
.st-downloads a::before {
	content: "↓";
	color: var(--wp--preset--color--orange);
	font-weight: 700;
	margin-right: 0.6rem;
}

/* Søgefeltet i Vidensportalens hero */
.st-soeg .wp-block-search__input {
	border: 0;
	border-radius: 999px;
	padding: 0.8rem 1.2rem;
	font-size: 1rem;
}
.st-soeg .wp-block-search__button {
	border-radius: 999px;
	background: var(--wp--preset--color--orange);
	color: var(--wp--preset--color--skov);
	margin-left: 0.5rem;
}
.st-soeg .wp-block-search__inside-wrapper {
	border: 0;
	padding: 0;
}

/* Datokassen ved arrangementer */
.st-dato {
	width: 64px;
	min-width: 64px;
	height: 64px;
	box-sizing: border-box;
	border: 1.5px solid var(--wp--preset--color--oliven);
	border-radius: 12px;
	background: var(--wp--preset--color--base);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	line-height: 1.1;
	font-family: var(--wp--preset--font-family--poppins);
	color: var(--wp--preset--color--skov);
}
.st-dato p {
	margin: 0;
}
.st-dato p:first-child {
	font-weight: 700;
	font-size: 1.375rem;
}
.st-dato p:last-child {
	font-size: 0.75rem;
}
