@import url('../../css/acf-block.css');

.anchor-links {
	border-bottom: 1px solid var(--grey);
}

.anchor-links-group {
	margin-top: 5rem;
}

.anchor-links .wp-block-heading {
	position: relative;
	display: block;
	width: 100%;
	padding: 14px 1.5rem;
	font-weight: 800;
	font-size: 1.6rem;
	background: #f5f5f5;
	border: none;
	display: flex;
	justify-content: space-between;
	align-items: center;
	cursor: pointer;
	color: var(--navy-blue);
	order: 2;
	border-top: 1px solid var(--grey);
}

.anchor-links .wp-block-heading:after {
	position: absolute;
	top: 0;
	bottom: 0;
	right: 1rem;
	margin: auto;
	content: '';
	width: 16px;
	height: 12px;
	background-image: url("data:image/svg+xml,%3Csvg width='800px' height='800px' viewBox='-19.04 0 75.804 75.804' xmlns='http://www.w3.org/2000/svg'%3E%3Cg id='Group_65' data-name='Group 65' transform='translate(-831.568 -384.448)'%3E%3Cpath id='Path_57' data-name='Path 57' d='M833.068,460.252a1.5,1.5,0,0,1-1.061-2.561l33.557-33.56a2.53,2.53,0,0,0,0-3.564l-33.557-33.558a1.5,1.5,0,0,1,2.122-2.121l33.556,33.558a5.53,5.53,0,0,1,0,7.807l-33.557,33.56A1.5,1.5,0,0,1,833.068,460.252Z' fill='%23000000'/%3E%3C/g%3E%3C/svg%3E");
	background-size: cover;
	background-repeat: no-repeat;
	background-position: center;
	transform: rotate(90deg);
}

.anchor-links.open .wp-block-heading:after {
	transform: rotate(270deg);
}

.anchor-links-group > .acf-innerblocks-container:first-of-type {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1fr);
}

.anchor-links {
	margin: 0 -1.25rem;
}

.anchor-links .wp-block-list {
	display: none;
}

.anchor-links.open .wp-block-list{
	display: block;
}

.anchor-links .wp-block-list {
	padding-left: 0;
	list-style-type: none;
	margin: 0;
}

.anchor-links .wp-block-list li {
	padding: 0;
	margin: 0;
}

.anchor-links .wp-block-list li:first-of-type a {
	border-top: 0;
}

.anchor-links .wp-block-list li a {
	display: block;
	border-top: 1px solid #eee;
	text-decoration: none;
	font-size: 1.6rem;
	padding: .8rem 2rem;
    transition: background-color 0.3s ease-in-out, color 0.3s ease-in-out;
    color: var(--navy-blue);
}

© a.active {
	color: var(--royal-blue);
	background: #e8f2ff;
}

.anchor-links-content .wp-block-image {
	margin-top: 0 !important;
}

.anchor-links-content .wp-block-image figure,
.anchor-links-content .wp-block-image figure img {
	width: 100%;
}

@media (min-width: 768px) {
	.anchor-links-group > .acf-innerblocks-container:first-of-type {
		grid-template-columns: minmax(0, 1fr) minmax(0, 2.8fr);
	}

	.anchor-links-group .anchor-links {
		position: sticky;
		top: 14rem;
		align-self: start;
		padding-right: 1.5rem;
		margin: 0;
		border-bottom: none;
	}
	
	.anchor-links .wp-block-heading {
		background-color: transparent;
		border-top: none;
		padding: 0 0 .8rem 0;
		font-size: 26px;
		font-weight: 700;
		cursor: default;
	}

	.anchor-links .wp-block-heading:after {
		display: none;
	}

	.anchor-links .wp-block-list {
		display: block;
	}

	.anchor-links .wp-block-list li {
		position: relative;
		display: flex;
	}

	.anchor-links .wp-block-list li:last-of-type::before { 
		height: 36%;
	}

	.anchor-links .wp-block-list li::before {
		content: '';
		position: absolute;
		top: 1rem;
		left: 0.4rem;
		height: 100%;
		width: 1px;
		background-color: #464646;
	}

	.anchor-links .wp-block-list a {
		color: #002e51;
		padding-top: 0.3em !important;
    	padding-bottom: 0.3rem !important;
		line-height: 1.5;
		border: none !important;
	}

	.anchor-links .wp-block-list a::after {
		content: '';
		position: absolute;
		top: 0.5rem;
		left: 0;
		margin: auto;
		width: 0;
		height: 0; 
		border-top: 10px solid #fff;
		border-bottom: 10px solid #fff;
		border-left: 15px solid var(--navy-blue);
		opacity: 0;
		transition: opacity 0.3s ease;
	}

	.anchor-links .wp-block-list a.active:after { 
		opacity: 1;
	}

	.anchor-links .wp-block-list a:hover {
		text-decoration: underline;
		color: #0087c1;
	}

	.anchor-links-group .anchor-links {
		/* display: none; */
	}
}
