/* Rothenburg.se – separat mobilmeny
   Desktopmenyn #meny är helt oförändrad över 1000 px.
   Vid 1000 px och mindre ersätts den av denna hamburgermeny.
*/

.rm-mobile-menu {
	display: none;
}

/* Surfplatta + mobil */
@media (max-width: 1000px) {
	/* Dölj endast den gamla desktopmenyn. Dess CSS behöver inte ändras. */
	#meny {
		display: none !important;
	}

	.rm-mobile-menu {
		display: block;
		position: relative;
		width: 100%;
		margin: 0;
		padding: 0;
		background: #0b0b0b;
		border-bottom: 1px solid #2f2f2f;
		font-family: "Trebuchet MS", Verdana, Arial, sans-serif;
		text-align: left;
		z-index: 1000;
	}

	/* Checkboxen styr menyn men syns inte. */
	.rm-mobile-menu-toggle {
		position: absolute;
		width: 1px;
		height: 1px;
		margin: -1px;
		padding: 0;
		overflow: hidden;
		clip: rect(0 0 0 0);
		clip-path: inset(50%);
		white-space: nowrap;
		border: 0;
	}

	.rm-mobile-menu-bar {
		display: flex;
		align-items: center;
		justify-content: space-between;
		min-height: 54px;
		padding: 0 14px 0 18px;
		background: #0b0b0b;
	}

	.rm-mobile-menu-title {
		color: #fff;
		font-size: 18px;
		font-weight: 600;
		letter-spacing: 0.2px;
		line-height: 1;
	}

	.rm-mobile-menu-button {
		display: flex;
		flex-direction: column;
		justify-content: center;
		gap: 5px;
		width: 44px;
		height: 44px;
		margin: 0;
		padding: 10px;
		cursor: pointer;
		border-radius: 6px;
		-webkit-tap-highlight-color: transparent;
		transition: background-color 0.2s ease;
	}

	.rm-mobile-menu-button:hover,
	.rm-mobile-menu-button:focus {
		background: #252525;
	}

	.rm-mobile-menu-button span {
		display: block;
		width: 24px;
		height: 2px;
		margin: 0 auto;
		background: #fff;
		border-radius: 2px;
		transform-origin: center;
		transition:
			transform 0.25s ease,
			opacity 0.2s ease;
	}

	/* Hamburgaren blir ett kryss när menyn är öppen. */
	.rm-mobile-menu-toggle:checked
		~ .rm-mobile-menu-bar
		.rm-mobile-menu-button span:nth-child(1) {
		transform: translateY(7px) rotate(45deg);
	}

	.rm-mobile-menu-toggle:checked
		~ .rm-mobile-menu-bar
		.rm-mobile-menu-button span:nth-child(2) {
		opacity: 0;
	}

	.rm-mobile-menu-toggle:checked
		~ .rm-mobile-menu-bar
		.rm-mobile-menu-button span:nth-child(3) {
		transform: translateY(-7px) rotate(-45deg);
	}

	.rm-mobile-menu-panel {
		max-height: 0;
		overflow: hidden;
		visibility: hidden;
		background: #151515;
		border-top: 1px solid transparent;
		transition:
			max-height 0.35s ease,
			visibility 0s linear 0.35s,
			border-color 0.2s ease;
	}

	.rm-mobile-menu-toggle:checked ~ .rm-mobile-menu-panel {
		max-height: 650px;
		visibility: visible;
		border-top-color: #343434;
		transition:
			max-height 0.35s ease,
			visibility 0s linear 0s,
			border-color 0.2s ease;
	}

	.rm-mobile-menu-panel ul {
		display: block;
		width: 100%;
		margin: 0;
		padding: 7px 0;
		list-style: none;
	}

	.rm-mobile-menu-panel li {
		display: block;
		width: 100%;
		margin: 0;
		padding: 0;
		border: 0;
	}

	.rm-mobile-menu-panel li + li {
		border-top: 1px solid #282828;
	}

	.rm-mobile-menu-panel a,
	.rm-mobile-menu-panel a:visited {
		display: block;
		width: 100%;
		padding: 12px 18px;
		color: #e5e5e5;
		background: transparent;
		font-size: 16px;
		font-weight: 400;
		line-height: 1.3;
		text-decoration: none;
		transition:
			background-color 0.15s ease,
			color 0.15s ease,
			padding-left 0.15s ease;
	}

	.rm-mobile-menu-panel a:hover,
	.rm-mobile-menu-panel a:focus {
		padding-left: 22px;
		color: #fff;
		background: #242424;
		text-decoration: none;
	}

	.rm-mobile-menu-panel li.active > a {
		color: #fff;
		background: #222;
		font-weight: 600;
		box-shadow: inset 4px 0 0 #fff;
	}

	/* Tydlig tangentbordsfokus. */
	.rm-mobile-menu-toggle:focus
		~ .rm-mobile-menu-bar
		.rm-mobile-menu-button {
		outline: 2px solid #fff;
		outline-offset: -3px;
	}
}

/* Något kompaktare på små mobilskärmar. */
@media (max-width: 500px) {
	.rm-mobile-menu-bar {
		min-height: 50px;
		padding-left: 14px;
		padding-right: 8px;
	}

	.rm-mobile-menu-title {
		font-size: 17px;
	}

	.rm-mobile-menu-panel a,
	.rm-mobile-menu-panel a:visited {
		padding: 12px 14px;
		font-size: 16px;
	}

	.rm-mobile-menu-panel a:hover,
	.rm-mobile-menu-panel a:focus {
		padding-left: 18px;
	}
}
