/**
 * TEAB Regionkontor – kontorskort-grid.
 *
 * Kort med stad + badge, besöksadress, telefon och kontaktperson. Tunna
 * avdelare mellan korten (1px-grid). Ljust/mörkt schema efter sektionens
 * bakgrund. Porterad från mockupen (6-dark.html ".offices-grid"/".office").
 * Självförsörjande och scoped under .teab-offices.
 *
 * @package Teab_Moduler
 */

.teab-offices {
	/* Brand-standard – faller tillbaka på delade tema-tokens (flippar med sidan),
	   kan överskrivas per instans av modulen eller med .teab-offices--dark. */
	--teab-offices-green-ink: var(--teab-link, #006420);       /* länk på ljus yta (WCAG-säker) */
	--teab-offices-green-bright: var(--teab-accent-bright, #34AC5C); /* länk/fokus på mörk yta */
	--teab-offices-ink: var(--teab-text, #14201A);
	--teab-offices-muted: var(--teab-muted, #5C6B61);
	--teab-offices-surface: var(--teab-panel, #FFFFFF);
	--teab-offices-line: var(--teab-border, #E2EBE5);      /* yttre rutnätslinje */
	--teab-offices-line-soft: var(--teab-border, #EDF2EE); /* inre avdelare i kortet */

	--teab-offices-cols: 3;
	--teab-offices-pad: 36px 32px;
	--teab-offices-easing: cubic-bezier(.2, .6, .2, 1);

	/* Schemastyrda värden – sätts om av --dark nedan. */
	--teab-offices-link: var(--teab-offices-green-ink);
	--teab-offices-city: var(--teab-offices-ink);
	--teab-offices-name: var(--teab-offices-ink);
	--teab-offices-text: var(--teab-offices-muted);
	--teab-offices-card-bg: var(--teab-offices-surface);
	--teab-offices-grid-line: var(--teab-offices-line);
	--teab-offices-divider: var(--teab-offices-line-soft);

	/* Typsnitt: ärver temat (inherit). BB:s typsnittsväljare kan skriva över per instans. */
	--teab-offices-font-ui: var(--font-ui, inherit);
	--teab-offices-font-display: var(--font-display, var(--teab-offices-font-ui));
}

/* Mörkt schema (för mörka sektioner). */
.teab-offices--dark {
	--teab-offices-link: var(--teab-offices-green-bright);
	--teab-offices-city: #ECECEC;
	--teab-offices-name: #ECECEC;
	--teab-offices-text: rgba(236, 236, 236, 0.7);
	--teab-offices-card-bg: #1A1A1A;
	--teab-offices-grid-line: #2C2C2C;
	--teab-offices-divider: #232323;
}

.teab-offices__grid {
	display: grid;
	grid-template-columns: repeat(var(--teab-offices-cols), 1fr);
	gap: 1px;
	background: var(--teab-offices-grid-line);
	border: 1px solid var(--teab-offices-grid-line);
}

/* ============ KORT ============ */
.teab-office {
	background: var(--teab-offices-card-bg);
	padding: var(--teab-offices-pad);
}

.teab-office__city-row {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 16px;
}

.teab-office__city {
	margin: 0;
	font-family: var(--teab-offices-font-display);
	font-weight: var(--teab-offices-title-weight, 700);
	font-size: 30px;
	line-height: 1.1;
	letter-spacing: -0.01em;
	color: var(--teab-offices-city);
}

.teab-office__badge {
	flex: none;
	font-family: var(--teab-offices-font-ui);
	font-size: 12px;
	font-weight: 600;
	color: var(--teab-offices-text);
	white-space: nowrap;
}

.teab-office__addr {
	margin-top: 20px;
	padding-top: 18px;
	border-top: 1px solid var(--teab-offices-divider);
	font-family: var(--teab-offices-font-ui);
	font-size: 15px;
	line-height: 1.65;
	color: var(--teab-offices-text);
}

.teab-office__phone {
	display: inline-block;
	margin-top: 12px;
	font-family: var(--teab-offices-font-ui);
	font-weight: 600;
	color: var(--teab-offices-link);
	text-decoration: none;
	background-image: linear-gradient(currentColor, currentColor);
	background-size: 0% 1.5px;
	background-position: 0 100%;
	background-repeat: no-repeat;
	transition: background-size 0.3s var(--teab-offices-easing);
}

.teab-office__phone:hover { background-size: 100% 1.5px; }

.teab-office__phone:focus-visible {
	outline: 2px solid var(--teab-offices-green-bright);
	outline-offset: 3px;
}

.teab-office__person {
	margin-top: 20px;
	padding-top: 18px;
	border-top: 1px solid var(--teab-offices-divider);
}

.teab-office__person-name {
	display: block;
	font-family: var(--teab-offices-font-ui);
	font-weight: 600;
	font-size: 15px;
	color: var(--teab-offices-name);
}

.teab-office__person-title {
	display: block;
	margin-top: 2px;
	font-family: var(--teab-offices-font-ui);
	font-size: 14px;
	color: var(--teab-offices-text);
}

.teab-office__person-links {
	margin-top: 14px;
	display: flex;
	flex-direction: column;
	gap: 9px;
}

.teab-office__person-link {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	width: fit-content;
	max-width: 100%;
	font-family: var(--teab-offices-font-ui);
	font-size: 14px;
	font-weight: 600;
	color: var(--teab-offices-link);
	text-decoration: none;
	/* currentColor-streck som ritas in vid hover (på texten, ej ikonen). */
	background-image: linear-gradient(currentColor, currentColor);
	background-size: 0% 1.5px;
	background-position: 0 100%;
	background-repeat: no-repeat;
	transition: background-size 0.3s var(--teab-offices-easing);
	overflow-wrap: anywhere;
}

.teab-office__person-link:hover { background-size: 100% 1.5px; }

.teab-office__person-link:focus-visible {
	outline: 2px solid var(--teab-offices-green-bright);
	outline-offset: 3px;
}

.teab-office__person-link svg {
	flex: none;
	width: 16px;
	height: 16px;
}

/* ============ RESPONSIVT ============ */
@media (max-width: 980px) {
	.teab-offices__grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
	.teab-offices__grid { grid-template-columns: 1fr; }
}

/* Diskret platshållare i editorn när inga kontor lagts till. */
.teab-offices--empty {
	padding: 32px;
	border: 1px dashed var(--teab-offices-grid-line);
	border-radius: 4px;
	color: var(--teab-offices-text);
	font-family: var(--teab-offices-font-ui);
}
