/* ============================================================
   competence-in-diamond.com – Stylesheet
   Grundlage: WORX-Entwurf 2011 (weisse Karte auf Grau, gepunktete
   Linien, Sprachschalter oben rechts), grosszügiger umgesetzt.
   Farbkonzept aus dem Header-Bild: Weiss, Hellgrau, Braun-Töne.
   ============================================================ */

:root {
	--bg:            #ebebeb;
	--card:          #ffffff;
	--text:          #2b2521;
	--text-soft:     #6e625b;
	--muted:         #a39891;
	--rule:          #9d8f86;   /* gepunktete Linien */
	--hover:         #f7f2ee;   /* Hellbeige (Hover-Zeile im Entwurf) */
	--accent:        #6b4a2f;   /* Diamant-Braun */
	--accent-dark:   #3e2a19;
	--shadow:        0 18px 50px rgba(60, 40, 20, .14), 0 2px 6px rgba(60, 40, 20, .08);
	--card-width:    780px;
	--pad:           20px;      /* Innenrand der Karte = Rand um das Header-Bild */
	--content-pad:   48px;      /* Einzug der Listen (Entwurf: Liste steht eingerückt) */
}

@font-face {
	font-family: 'Lato';
	font-style: normal;
	font-weight: 300;
	font-display: swap;
	src: url('../fonts/lato-v25-latin_latin-ext-300.woff2') format('woff2');
}
@font-face {
	font-family: 'Lato';
	font-style: normal;
	font-weight: 700;
	font-display: swap;
	src: url('../fonts/lato-v25-latin_latin-ext-700.woff2') format('woff2');
}

*, *::before, *::after { box-sizing: border-box; }

html {
	background: var(--bg);
	-webkit-text-size-adjust: 100%;
	overflow-y: scroll;   /* Scrollbalken immer zeigen – sonst springt das Layout zwischen langer Liste und kurzer Kategorieseite */
}

body {
	margin: 0;
	padding: 56px 16px 72px;
	font-family: 'Lato', 'Helvetica Neue', Arial, sans-serif;
	font-weight: 300;
	font-size: 18px;
	line-height: 1.6;
	color: var(--text);
	background: var(--bg);
}

a {
	color: inherit;
	text-decoration: none;
}
a:focus-visible, button:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 3px;
}

img { max-width: 100%; height: auto; display: block; }

.visually-hidden {
	position: absolute !important;
	width: 1px; height: 1px;
	margin: -1px; padding: 0;
	overflow: hidden; clip: rect(0 0 0 0);
	white-space: nowrap; border: 0;
}

/* ------------------------------------------------------------
   Karte
   ------------------------------------------------------------ */
.page {
	max-width: var(--card-width);
	margin: 0 auto;
	padding: var(--pad) var(--pad) 40px;
	background: var(--card);
	box-shadow: var(--shadow);
}

.site-header-image {
	width: 100%;
	max-width: 740px;
	margin: 0 auto;
}

/* Sprachschalter – oben rechts, kleine Versalien, gepunktet unterstrichen */
.lang-menu {
	display: flex;
	justify-content: flex-end;
	margin: 22px 0 40px;
}
.lang-menu-items {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	align-items: stretch;
	min-width: 96px;
}
.lang-menu-item {
	font-size: 12px;
	letter-spacing: .12em;
	text-transform: uppercase;
	text-align: right;
	border-bottom: 1px dotted var(--rule);
	line-height: 1;
}
.lang-menu-item a,
.lang-menu-item span {
	display: block;
	padding: 6px 2px;
	color: var(--muted);
	transition: color .15s;
}
.lang-menu-item a:hover { color: var(--accent-dark); }
.lang-menu-item.is-active span { color: var(--text); font-weight: 700; }

/* ------------------------------------------------------------
   Inhalt
   ------------------------------------------------------------ */
.content {
	padding: 0 var(--content-pad) 0 calc(var(--content-pad) + 40px);   /* links Platz für das Listen-Icon */
	min-height: 240px;
}

.intro {
	margin: 0 0 22px;
	font-size: 15px;
	color: var(--text-soft);
}

/* Kategorie-Auswahl (Startseite): natives <select>, gestaltet wie eine Listenzeile */
.category-select-form {
	margin: 0;
	border-top: 1px dotted var(--rule);
	border-bottom: 1px dotted var(--rule);
}
.category-select {
	display: block;
	width: 100%;
	margin: 0;
	padding: 11px 40px 9px 4px;
	border: 0;
	border-radius: 0;
	background: transparent
		url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236e625b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E")
		no-repeat right 10px center / 22px 22px;
	font: inherit;
	font-size: 19px;
	line-height: 1.6;
	color: var(--text);
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
	transition: background-color .15s, padding-left .15s;
}
.category-select:hover,
.category-select:focus-visible {
	background-color: var(--hover);
	padding-left: 10px;
}
.category-select:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.category-select option { font-weight: 300; color: var(--text); background: var(--card); }
.category-select-submit { margin: 14px 0 0 4px; }

/* Kopf der Kategorieseite: Icon links ausserhalb, Titel wie eine Listenzeile */
.category-head {
	position: relative;
	border-top: 1px dotted var(--rule);
	border-bottom: 1px dotted var(--rule);
	margin-bottom: 36px;
}
.category-title {
	margin: 0;
	font-size: 19px;
	font-weight: 300;
	line-height: 1.6;
}
/* Ganze Titelzeile ist der Zurück-Link (Icon + Titel) */
.back-link {
	position: relative;
	display: flex;
	align-items: center;
	padding: 11px 4px 9px;
	transition: background-color .15s;
}
.back-link:hover,
.back-link:focus-visible { background: var(--hover); }
.back-icon {
	position: absolute;
	left: -46px;
	top: 50%;
	transform: translateY(-50%);
	display: flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	color: var(--rule);
	transition: color .15s, transform .15s;
}
.back-link:hover .back-icon { color: var(--accent-dark); transform: translateY(-50%) translateX(-2px); }
.icon { display: block; }

/* Firmen */
.company-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	column-gap: 40px;
}
.company-item { border-bottom: 1px dotted var(--rule); min-width: 0; }
.company-link {
	display: flex;
	flex-direction: column;
	gap: 14px;
	padding: 28px 8px 12px;
	height: 100%;
	transition: background-color .15s;
}
a.company-link:hover,
a.company-link:focus-visible { background: var(--hover); }
.company-logo {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 88px;
}
.company-logo img {
	max-height: 88px;
	max-width: 240px;
	width: auto;
	object-fit: contain;
	filter: saturate(.92);
	transition: filter .15s, transform .2s;
}
a.company-link:hover .company-logo img { filter: none; transform: scale(1.03); }
.company-logo-placeholder {
	font-family: 'Courier New', Courier, monospace;
	font-size: 20px;
	letter-spacing: .22em;
	text-transform: uppercase;
	color: var(--text-soft);
	text-align: center;
}
.company-meta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	font-size: 13px;
	color: var(--muted);
	letter-spacing: .02em;
}
.company-host { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.company-flag { flex: none; width: 24px; height: 18px; border: 1px solid rgba(0,0,0,.08); }

.empty {
	margin: 0 0 24px;
	color: var(--text-soft);
}
.text-link { border-bottom: 1px dotted var(--rule); color: var(--accent-dark); }

/* Textseiten (Impressum, Datenschutz) */
.text h2 { font-size: 19px; font-weight: 700; margin: 36px 0 8px; }
.text h3 { font-size: 16px; font-weight: 700; margin: 24px 0 4px; }
.text h2:first-child, .text h3:first-child { margin-top: 0; }
.text p  { margin: 0 0 14px; font-size: 16px; }
.text a  { color: var(--accent-dark); border-bottom: 1px dotted var(--rule); }
.text .address { line-height: 1.5; }

/* ------------------------------------------------------------
   Footer
   ------------------------------------------------------------ */
.site-footer {
	margin: 64px var(--content-pad) 0 calc(var(--content-pad) + 40px);
	padding-top: 14px;
	/*border-top: 1px dotted var(--rule);*/
	font-size: 12.5px;
	letter-spacing: .04em;
	color: var(--muted);
}
.site-footer p { margin: 0 0 4px; }
.site-footer a,
.link-button { color: var(--text-soft); }
.site-footer a:hover,
.link-button:hover { color: var(--accent-dark); }
.site-footer-sep { margin: 0 8px; }
.link-button {
	background: none;
	border: 0;
	padding: 0;
	margin: 0;
	font: inherit;
	letter-spacing: inherit;
	cursor: pointer;
}

/* ------------------------------------------------------------
   Cookie-Consent
   ------------------------------------------------------------ */
.cookie-consent {
	position: fixed;
	left: 16px;
	right: 16px;
	bottom: 16px;
	z-index: 100;
	display: flex;
	justify-content: center;
	pointer-events: none;
}
.cookie-consent[hidden] { display: none; }   /* Klasse würde sonst das hidden-Attribut überstimmen */
.cookie-consent-inner {
	pointer-events: auto;
	width: 100%;
	max-width: 560px;
	padding: 22px 26px 20px;
	background: var(--card);
	color: var(--text);
	box-shadow: var(--shadow);
	border-top: 3px solid var(--accent);
	font-size: 14px;
	line-height: 1.5;
}
.cookie-consent-title { margin: 0 0 6px; font-size: 16px; font-weight: 700; }
.cookie-consent-text  { margin: 0 0 10px; }
.cookie-consent-privacy { margin: 0 0 14px; font-size: 13px; }
.cookie-consent-privacy a { color: var(--accent-dark); border-bottom: 1px dotted var(--rule); }
.cookie-consent-buttons { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.button {
	font: inherit;
	font-size: 14px;
	letter-spacing: .04em;
	padding: 9px 18px;
	border: 1px solid var(--accent);
	background: var(--card);
	color: var(--accent-dark);
	cursor: pointer;
	transition: background-color .15s, color .15s;
}
.button.primary { background: var(--accent); color: #fff; }
.button.primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.button.secondary:hover { background: var(--hover); }

/* ------------------------------------------------------------
   Kleine Bildschirme
   ------------------------------------------------------------ */
@media (max-width: 800px) {
	body { padding: 0 0 40px; font-size: 17px; }
	.page { padding: 12px 12px 32px; box-shadow: none; }
	/* Inhalt bündig mit dem Header-Bild, kein seitliches Padding */
	.content { padding: 0; }
	.site-footer { margin: 48px 0 0; }
	.category-select, .category-title { font-size: 17px; }
	/* Kategorieseite: Zurück-Pfeil links, danach der Titel */
	.back-link { padding-left: 0; }
	.back-icon {
		position: static;
		transform: none;
		flex: none;
		margin: 0 6px 0 -4px;
		color: var(--text-soft);
	}
	.back-link:hover .back-icon { transform: translateX(-2px); }
	.category-title-text { min-width: 0; }
	/* Sprachen als Zeile, linksbündig, ohne Unterstreichung */
	.lang-menu { justify-content: flex-start; margin: 18px 0 32px; }
	.lang-menu-items { flex-direction: row; gap: 22px; min-width: 0; }
	.lang-menu-item { border-bottom: 0; text-align: left; }
	.lang-menu-item a, .lang-menu-item span { padding: 6px 0; }
}
@media (max-width: 560px) {
	.company-list { grid-template-columns: 1fr; column-gap: 0; }
	.cookie-consent { left: 0; right: 0; bottom: 0; }
}
