/*
Theme Name: ERF Medlemswebben
Theme URI: https://eloverkanslig.org
Description: Child theme for Elöverkänsligas Riksförbund Medlemswebben — calm intranet facelift on Twenty Twenty-Five. EHS-friendly: low density, no animation, generous spacing, Swedish UI.
Author: Elöverkänsligas Riksförbund / Design
Author URI: https://eloverkanslig.org
Template: twentytwentyfive
Version: 0.1.1
Requires at least: 6.7
Tested up to: 6.8
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: erf-medlemswebben
Tags: accessibility-ready, full-site-editing, block-patterns, custom-colors
*/

/* Calm intranet — low density, visible focus, reduced motion */

:root {
	--erf-orange: #e87722;
	--erf-ink: #1a1a1a;
	--erf-muted: #6b6b6b;
	--erf-bg: #f4f4f4;
	--erf-card: #ffffff;
	--erf-line: #c8c8c8;
	--erf-focus: #e87722;
}

body {
	color: var(--erf-ink);
	background-color: var(--erf-bg);
}

.erf-role-chip {
	display: inline-block;
	font-family: system-ui, -apple-system, sans-serif;
	font-size: 0.75rem;
	font-weight: 600;
	line-height: 1.4;
	background: #fff5eb;
	color: #9a4a00;
	border: 1px solid var(--erf-orange);
	border-radius: 999px;
	padding: 0.25rem 0.75rem;
	margin: 0 0 0.75rem;
}

.erf-task-card,
.wp-block-group.erf-task-card {
	background: var(--erf-card);
	border: 1px solid var(--erf-line);
	border-radius: 8px;
	padding: 1rem 1.1rem;
	min-height: 5.5rem;
	height: 100%;
	color: inherit;
	display: block;
	text-decoration: none;
	transition: none;
}

.erf-task-card:hover,
.erf-task-card:focus,
.wp-block-group.erf-task-card:hover,
.wp-block-group.erf-task-card:focus-within {
	border-color: var(--erf-orange);
	outline: 2px solid var(--erf-orange);
	outline-offset: 2px;
}

.erf-task-card.is-primary,
.wp-block-group.erf-task-card.is-primary {
	border-color: var(--erf-orange);
	border-width: 2px;
}

.erf-task-card .erf-task-accent {
	width: 1.75rem;
	height: 1.75rem;
	border: 2px solid var(--erf-orange);
	margin-bottom: 0.5rem;
	opacity: 0.7;
}

.erf-task-card strong,
.erf-task-card .erf-task-title,
.erf-task-card h3,
.erf-task-card .wp-block-heading {
	display: block;
	font-family: system-ui, -apple-system, sans-serif;
	font-size: 0.95rem;
	font-weight: 700;
	margin: 0 0 0.35rem;
	color: var(--erf-ink);
	/* Prevent one-char-per-line / vertical collapse in flex columns */
	writing-mode: horizontal-tb;
	word-break: normal;
	overflow-wrap: break-word;
	white-space: normal;
	width: 100%;
	max-width: 100%;
	min-width: 0;
	box-sizing: border-box;
}

/* Task cards inside columns must keep horizontal readable width */
.wp-block-column > .erf-task-card,
.wp-block-column > .wp-block-group.erf-task-card,
.wp-block-column > .wp-block-group.has-border-color {
	min-width: 0;
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
}

/* Same heading fix for bordered card groups even without erf-task-card class */
.wp-block-column > .wp-block-group.has-border-color h3,
.wp-block-column > .wp-block-group.has-border-color .wp-block-heading {
	writing-mode: horizontal-tb;
	word-break: normal;
	overflow-wrap: break-word;
	white-space: normal;
	width: 100%;
	max-width: 100%;
	min-width: 0;
	box-sizing: border-box;
}

/* Prefer wrapping columns over ultra-narrow flex items */
.entry-content > .wp-block-columns.wp-block-columns-is-layout-flex {
	flex-wrap: wrap !important;
	width: 100%;
	max-width: 100%;
}

.entry-content > .wp-block-columns > .wp-block-column {
	flex-grow: 1;
	flex-basis: min(100%, 16rem);
	min-width: min(100%, 12rem);
}

.erf-task-card .erf-task-desc,
.erf-task-card p {
	font-family: system-ui, -apple-system, sans-serif;
	font-size: 0.8rem;
	color: var(--erf-muted);
	margin: 0;
	line-height: 1.4;
}

a.erf-task-card {
	text-decoration: none;
}

.erf-badge {
	display: inline-block;
	font-family: system-ui, sans-serif;
	font-size: 0.65rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	border: 1px solid var(--erf-line);
	padding: 0.15rem 0.4rem;
	color: var(--erf-muted);
	margin-right: 0.4rem;
	border-radius: 2px;
}

.erf-badge.is-inloggade,
.erf-badge.is-riks,
.erf-badge.is-forening {
	border-color: var(--erf-orange);
	color: #9a4a00;
}

header.wp-block-template-part,
.erf-site-header {
	position: sticky;
	top: 0;
	z-index: 100;
	background: var(--erf-card);
	border-bottom: 3px solid var(--erf-orange);
	box-shadow: none;
}

a:focus-visible,
button:focus-visible,
.wp-block-navigation a:focus-visible,
.wp-block-button__link:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
	outline: 2px solid var(--erf-focus);
	outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}

.entry-content a:not(.wp-block-button__link):not(.erf-task-card) {
	text-decoration: underline;
	text-underline-offset: 0.15em;
	color: var(--erf-ink);
}

.entry-content a:not(.wp-block-button__link):hover {
	color: #9a4a00;
}

.erf-section-card {
	background: var(--erf-card);
	border: 1px solid var(--erf-line);
	border-radius: 8px;
	padding: 1.1rem 1.25rem;
}

.erf-hero {
	background: var(--erf-card);
	border: 1px solid var(--erf-line);
	border-radius: 8px;
	padding: 1.25rem 1.35rem 1.5rem;
	margin-bottom: 1.25rem;
}

.erf-hero h1 {
	font-family: system-ui, -apple-system, sans-serif;
	font-weight: 700;
	margin-top: 0;
}

.erf-lead {
	color: var(--erf-muted);
	font-size: 0.95rem;
	margin-bottom: 1rem;
}

body.erf-role-medlem .erf-role-hint-medlem,
body.erf-role-forening .erf-role-hint-forening,
body.erf-role-riksstyrelse .erf-role-hint-riksstyrelse {
	/* hook for future role-specific polish */
}
