body {
	grid-template-rows: max-content max-content max-content auto;
}

/* Link hover color */
header h1#site-title a:hover, nav#submenu a:hover, aside#filters ul li a:hover {
	color: var(--blue-gray);
}

/* Filtering and Sorting */
aside#filters {
	grid-column: 1 / 2;
	grid-row: 4;
	width: max-content;
}
aside#filters #collection {
  margin-bottom: 26px;
  font-size: var(--p);
  line-height: var(--p-leading);
}
aside#filters ul {
  list-style: none;
}
aside#filters ul li {
  font-size: var(--p);
}
aside#filters ul li a {
  color: var(--text-color);
  text-decoration: none;
}
aside#filters ul li a:hover {
  text-decoration: underline;
  text-decoration-color: var(--blue-gray);
}
aside#filters ul li::before {
  content: "\2022";
  font-weight: bold;
  display: inline-block; 
  width: .8em;
  margin-left: .1em;
}
aside#filters ul li::before {
  color: var(--blue-gray);
}
aside#filters ul li.active a {
  text-decoration: underline;
}
aside#filters ul li.active a {
  text-decoration-color: var(--blue-gray);
}

/* Collection Filtering */
#filtering-and-sort-container {
	grid-column: 2 / 6;
	grid-row: 3;
	width: 100%;
	max-width: 900px;
	margin: 0 auto;
	margin-bottom: -6px;
}
#filtering-and-sort {
	display: flex;
	font-size: var(--p);
	align-items: center;
}
#filtering-and-sort #filtering-by span {
	border: 1px solid var(--blue-gray);
    padding: 5px 6px 1px 6px;
	margin-right: 4px;
}
#filtering-and-sort #sort-by a {
	font-size: var(--p);
	margin-right: 4px;
	color: var(--blue-gray);
	text-decoration: none;
}
#filtering-and-sort #sort-by a.active, #filtering-and-sort #sort-by a:hover {
	text-decoration: underline;
	color: var(--text-color);
	text-decoration-color: var(--blue-gray);
}
/* #filtering-and-sort #sort-by a.active:hover {
	color: var(--blue-gray);
} */
#filtering-and-sort #sort-by a.active.desc::after {
	transform: rotate(180deg);
	margin-bottom: -5px;
}
#filtering-and-sort #sort-by a::after {
	margin-left: 6px;
	display: inline-block;
    content: '';
    width: 0px;
    height: 0px;
	border-top: 5px solid transparent;
	border-bottom: 8px solid var(--blue-gray);
	border-right: 5px solid transparent;
	border-left: 5px solid transparent;
	margin-bottom: 1px;
}
#filtering-and-sort #sort-by a.active::after, #filtering-and-sort #sort-by a:hover::after {
	border-bottom-color: var(--text-color);
}
#filtering-and-sort #sort-by a.active:hover::after {
	border-bottom-color: var(--blue-gray);
}

/* Collection Grid */
#collection-grid-container {
	grid-column: 2 / 6;
	grid-row: 4;
	width: 100%;
	max-width: 900px;
	margin: 0 auto;
	justify-self: center;
}
#collection-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	grid-gap: 26px;
}
#collection-grid a {
	display: flex;
	position: relative;
	flex-flow: row nowrap;
	justify-content: center;
	align-items: center;
	border: 1px solid var(--blue-gray);
	/* height: 30vw;
	max-height: 406px; */
	color: var(--text-color);
	text-decoration: none;
	background-color: var(--white);
	aspect-ratio: 1 / 1;
}
#collection-grid a:hover {
	border-color: var(--blue-gray-light);
}
#collection-grid a .title-and-date {
	display: flex;
	width: 100%;
	position: relative;
	flex-flow: row nowrap;
	position: absolute;
	top: 0;
	left: 0;
	padding: 19px;
}
#collection-grid a.portrait .title-and-date {
	transform: rotate(-90deg);
	bottom: 0;
	left: 0;
	width: 100%;
}
#collection-grid a .title-and-date .title {
    font-size: var(--p);
    line-height: var(--p-leading);
}
#collection-grid a .title-and-date .date {
	margin-left: auto;
	font-size: var(--caption);
	line-height: var(--caption-leading);
    padding-top: 5px;
}
#collection-grid a.portrait figure {
	padding: 26px 52px;
}
#collection-grid a.landscape figure {
	padding: 52px 26px;
}
#collection-grid figure {
	height: 100%;
    width: 100%;
}
#collection-grid img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

/* Films */
#films #collection-grid {
	display: grid;
	grid-template-columns: 1fr;
	grid-gap: 26px;
}
#films #collection-grid a {
	aspect-ratio: 2 / 1;
}
#films #collection-grid a .title-and-date {
	transform: rotate(-90deg);
	bottom: 0;
	left: 0;
	width: 49%;
}
#films #collection-grid figure {
	padding: 26px 52px;
}
#films #collection-grid .cover-image {
	width: 100%;
}


/* Breakpoints */

@media (max-width: 994px) {
	#collection-grid {
		grid-template-columns: 1fr;
	}
}

/* Tablet */
@media (max-width: 948px) {

}

/* Mobile */
@media(max-width: 642px) {
    #filtering-and-sort-container {
        grid-column: 1 / 5;
		grid-row: 3;
    }
	aside#filters {
		grid-column: 1 / 5;
		grid-row: 4;
		display: grid;
		grid-template-columns: 1fr 1fr;
		grid-gap: 26px;
		width: 100%;
	}
	aside#filters #collection {
		margin-bottom: 0;
	}
	#collection-grid-container {
		grid-column: 1 / 5;
		grid-row: 5;
	}
	#collection-grid {
		grid-template-columns: 1fr;
	}
	footer {
		grid-row: 5;
	}
}