/**
 * Strömavbrott – frontend.
 *
 * Färgploppens egna regler genereras dynamiskt av HS_Frontend::inline_css()
 * eftersom selektorn (.stromavbrott) och färgerna är inställningsbara.
 * Här ligger banner, listor, formulär och karta.
 */

/* --------------------------------------------------------------------------
   Banner
   -------------------------------------------------------------------------- */

.hs-banner {
	position: relative;
	width: 100%;
	background: var(--hs-level-bg-3, #d07151);
	color: #fff;
}

.hs-banner__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 10px 20px;
	max-width: 1170px;
	margin: 0 auto;
	padding: 14px 20px;
}

.hs-banner__title {
	margin: 0;
	font-size: 18px;
	line-height: 1.3;
	color: #fff;
}

.hs-banner__text {
	margin: 0;
	flex: 1 1 auto;
}

.hs-banner__actions {
	display: flex;
	align-items: center;
	gap: 15px;
}

.hs-banner__link {
	display: inline-block;
	padding: 6px 14px;
	background: #fff;
	border-radius: 3px;
	color: inherit;
	text-decoration: none;
	font-weight: 600;
	white-space: nowrap;
}

.hs-banner__link:hover,
.hs-banner__link:focus {
	text-decoration: underline;
}

.hs-banner__close {
	position: relative;
	width: 28px;
	height: 28px;
	padding: 0;
	border: 0;
	background: transparent;
	cursor: pointer;
	flex: 0 0 auto;
}

.hs-banner__close::before,
.hs-banner__close::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 4px;
	width: 20px;
	height: 2px;
	background: #fff;
}

.hs-banner__close::before {
	transform: rotate(45deg);
}

.hs-banner__close::after {
	transform: rotate(-45deg);
}

.hs-banner--level-1 { background: var(--hs-level-bg-1, #91b35f); }
.hs-banner--level-2 { background: var(--hs-level-bg-2, #dfb551); }
.hs-banner--level-3 { background: var(--hs-level-bg-3, #d07151); }

/* --------------------------------------------------------------------------
   Statuslänk (shortcode [stromavbrott_status])
   -------------------------------------------------------------------------- */

.hs-status-link {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	text-decoration: none;
	padding-right: 16px;
}

/* --------------------------------------------------------------------------
   Avbrottslistor
   -------------------------------------------------------------------------- */

.hs-interruptions {
	width: 100%;
	overflow-x: auto;
}

.hs-interruptions__empty {
	margin: 20px 0;
	padding: 20px;
	background: #f5f5f5;
	text-align: center;
}

.hs-interruptions table {
	width: 100%;
	border-collapse: collapse;
}

.hs-interruptions th,
.hs-interruptions td {
	padding: 10px 12px;
	border-bottom: 1px solid #e2e2e2;
	text-align: left;
	vertical-align: top;
}

.hs-interruptions th {
	font-weight: 600;
	white-space: nowrap;
}

.hs-interruptions .hs-col-start,
.hs-interruptions .hs-col-end {
	width: 160px;
	white-space: nowrap;
}

.hs-interruptions ul {
	margin: 0;
	padding-left: 18px;
	list-style: disc;
}

.hs-interruptions ul ul {
	list-style: circle;
}

.hs-interruptions p {
	margin: 0 0 6px;
}

.hs-interruptions p:last-child {
	margin-bottom: 0;
}

@media (max-width: 767px) {
	.hs-interruptions table,
	.hs-interruptions thead,
	.hs-interruptions tbody,
	.hs-interruptions tr,
	.hs-interruptions td {
		display: block;
		width: 100%;
	}

	.hs-interruptions thead {
		display: none;
	}

	.hs-interruptions tr {
		margin-bottom: 20px;
		border: 1px solid #e2e2e2;
	}

	.hs-interruptions td {
		border-bottom: 1px solid #f0f0f0;
	}

	.hs-interruptions td::before {
		content: attr(data-label);
		display: block;
		font-weight: 600;
		margin-bottom: 4px;
	}

	.hs-interruptions .hs-col-start,
	.hs-interruptions .hs-col-end {
		width: auto;
	}
}

/* --------------------------------------------------------------------------
   Publikt registreringsformulär
   -------------------------------------------------------------------------- */

.hs-form fieldset {
	margin: 0 0 20px;
	padding: 15px;
	border: 1px solid #e2e2e2;
}

.hs-form legend {
	padding: 0 6px;
	font-weight: 600;
}

.hs-form label {
	display: block;
	margin-bottom: 4px;
	font-weight: 600;
}

.hs-form select,
.hs-form textarea,
.hs-form input[type="text"],
.hs-form input[type="datetime-local"] {
	width: 100%;
	padding: 8px;
	border: 1px solid #ccc;
}

.hs-form__areas {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 20px;
}

.hs-form__city > label,
.hs-form__area label {
	display: inline-block;
	font-weight: 400;
	margin: 0 0 0 6px;
}

.hs-form__city-title {
	margin: 0 0 8px;
	font-weight: 700;
}

.hs-form__area {
	margin: 3px 0;
}

.hs-form__notice {
	margin: 0 0 20px;
	padding: 12px 15px;
	border-left: 4px solid #76a037;
	background: #f3f7ec;
}

.hs-form__notice--error {
	border-left-color: #c44d26;
	background: #fbeee9;
}

/* --------------------------------------------------------------------------
   Karta
   -------------------------------------------------------------------------- */

.hs-map__canvas {
	width: 100%;
	height: 500px;
	background: #eee;
}

.hs-map__legend {
	display: flex;
	flex-wrap: wrap;
	gap: 20px;
	margin: 15px 0;
}

.hs-map__legend-item {
	display: flex;
	align-items: center;
	gap: 8px;
}

.hs-map__legend-dot {
	width: 14px;
	height: 14px;
	border-radius: 50%;
	display: inline-block;
}

.hs-map__stats table {
	border-collapse: collapse;
}

.hs-map__stats th,
.hs-map__stats td {
	padding: 6px 12px;
	border: 1px solid #e2e2e2;
}
