/* GIR Tømmekalender. Farger arves fra Elementors globale farger (Site Settings), med GIR-profilen som reserve. */

.gir-tk {
	--tk-ink: var(--e-global-color-secondary, #0d2621);
	--tk-accent: var(--e-global-color-primary, #3cac3c);
	--tk-link: var(--e-global-color-accent, #266f28);
	--tk-muted: #4b534b;
	--tk-line: #d2dad1;
	--tk-field: #869287;
	--tk-focus: #bde6bb;
	--tk-surface: #fff;
	--tk-radius: 14px;
	color: var(--tk-ink);
}

.gir-tk__label { display: block; margin-bottom: 8px; font-weight: 500; }

.gir-tk__msg { display: none; margin: 12px 0 0; color: var(--tk-muted); }
.gir-tk[data-state="loading"] .gir-tk__msg--loading,
.gir-tk[data-state="error"] .gir-tk__msg--error { display: block; }
.gir-tk__msg a { color: var(--tk-link); font-weight: 600; }

/* Skjul det vi ikke bruker fra Norkarts markup */
.gir-tk #innledning,
.gir-tk #select,
.gir-tk #help,
.gir-tk #sms-div,
.gir-tk #messagePopup,
.gir-tk .tabs,
.gir-tk .wrapper h2 { display: none !important; }

.gir-tk .table { width: auto !important; }
.gir-tk #t1 { width: 100%; padding: 0 !important; background: none !important; }

/* Søkefelt */
.gir-tk #search {
	box-sizing: border-box;
	width: 100%;
	min-height: 56px;
	padding: 0 18px;
	font: inherit;
	font-size: 18px;
	color: inherit;
	background: var(--tk-surface);
	border: 2px solid var(--tk-field);
	border-radius: var(--tk-radius);
}
.gir-tk #search:focus { outline: none; border-color: var(--tk-accent); box-shadow: 0 0 0 4px var(--tk-focus); }
.gir-tk #searchAlert { display: block; margin-top: 8px; color: #904524; }

/* Resultat: én rad per avfallstype, sortert etter neste tømming */
.gir-tk #pElemAddress { margin: 28px 0 0; font-size: 20px; font-weight: 600; }
.gir-tk #label { margin: 0 0 12px; color: var(--tk-muted); }

.gir-tk #calendar { display: flex; flex-direction: column; border-top: 1px solid var(--tk-line); }

/* Skjul tomme resultatfelt før søk */
.gir-tk #pElemAddress:not(:has(*)),
.gir-tk #label:not(:has(*)),
.gir-tk #labellink:not(:has(a)),
.gir-tk #calendar:not(:has(.cal)) { display: none; }
.gir-tk .cal { padding: 14px 0; border-bottom: 1px solid var(--tk-line); }
.gir-tk .cal ul {
	display: grid;
	grid-template-columns: 40px minmax(0, 1fr) auto;
	gap: 2px 14px;
	align-items: center;
	margin: 0;
	padding: 0;
	list-style: none;
}
.gir-tk .cal li,
.gir-tk .cal table,
.gir-tk .cal tbody,
.gir-tk .cal tr { display: contents; }
.gir-tk .cal li:first-child { display: block; grid-row: 1 / 3; }
.gir-tk .ikon { display: block; width: 40px; height: 40px; border-radius: 8px; }
.gir-tk .cal li:nth-child(2) { display: block; grid-area: 1 / 2; font-weight: 600; line-height: 1.3; }
.gir-tk .cal td { display: block; padding: 0; background: none; border: 0; }
.gir-tk .cal tr:first-child td { grid-area: 1 / 3 / 3; text-align: right; font-weight: 600; white-space: nowrap; }
.gir-tk .cal tr:first-child td::after { content: attr(data-rel); display: block; font-size: 14px; font-weight: 400; color: var(--tk-muted); }
.gir-tk .cal:first-child tr:first-child td::after { font-weight: 600; color: var(--tk-link); }
.gir-tk .cal tr:nth-child(2) td { grid-area: 2 / 2; font-size: 14px; color: var(--tk-muted); }

/* PDF-lenker (Norkart legger inn « | » som tekst; skjules med font-size) */
.gir-tk #labellink { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-top: 16px; }
.gir-tk #labellink span { font-size: 0; }
.gir-tk #labellink a { font-size: 16px; font-weight: 600; color: var(--tk-link) !important; }

/* Lasting */
.gir-tk #overlay,
.gir-tk #spinner { display: none; position: fixed; }
.gir-tk #overlay { inset: 0; z-index: 100; background: rgb(13 38 33 / 0.3); }
.gir-tk #spinner { top: 50%; left: 50%; z-index: 101; width: 48px; height: 48px; margin: -24px; }

/* Adresseforslag (jQuery UI legger menyen i <body>) */
.ui-autocomplete.gir-tk-menu {
	position: absolute;
	z-index: 100;
	max-height: 320px;
	overflow: auto;
	margin: 0;
	padding: 6px;
	list-style: none;
	font-family: inherit;
	background: #fff;
	border: 1px solid #d2dad1;
	border-radius: 14px;
}
.gir-tk-menu .ui-menu-item { margin: 0; padding: 12px; border: 0; border-radius: 10px; cursor: pointer; }
.gir-tk-menu .ui-state-focus,
.gir-tk-menu .ui-state-active { margin: 0 !important; color: #0d2621 !important; background: #ddf2dc !important; border: 0 !important; }
