*,
*::after,
*::before {
	box-sizing: border-box;
}

:root {
	font-size: 15px;
}

body {
	margin: 0;
	--color-text: #000;
	--color-bg: #f7f5ee;
	--color-link: #000;
	--color-link-hover: #000;
	color: var(--color-text);
	background-color: var(--color-bg);
	font-family: rustica, -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	overflow: hidden;
	overflow-y: scroll;
	line-height: 1;
}

/* Page Loader */
.js .loading::before,
.js .loading::after {
	content: '';
	position: fixed;
	z-index: 1000;
}

.js .loading::before {
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: var(--color-bg);
}

.js .loading::after {
	top: 50%;
	left: 50%;
	width: 60px;
	height: 60px;
	margin: -30px 0 0 -30px;
	border-radius: 50%;
	opacity: 0.4;
	background: var(--color-link);
	animation: loaderAnim 0.7s linear infinite alternate forwards;

}

@keyframes loaderAnim {
	to {
		opacity: 1;
		transform: scale3d(0.5,0.5,1);
	}
}

a {
	text-decoration: none;
	color: var(--color-link);
	outline: none;
	font-weight: 600;
}

a:hover {
	color: var(--color-link-hover);
	outline: none;
}

/* Better focus styles from https://developer.mozilla.org/en-US/docs/Web/CSS/:focus-visible */
a:focus {
	/* Provide a fallback style for browsers
	 that don't support :focus-visible */
	outline: none;
	background: lightgrey;
}

a:focus:not(:focus-visible) {
	/* Remove the focus indicator on mouse-focus for browsers
	 that do support :focus-visible */
	background: transparent;
}

a:focus-visible {
	/* Draw a very noticeable focus style for
	 keyboard-focus on browsers that do support
	 :focus-visible */
	outline: 2px solid red;
	background: transparent;
}

.unbutton {
	background: none;
	border: 0;
	padding: 0;
	margin: 0;
	font: inherit;
}

.unbutton:focus {
	outline: none;
}

.line {
	transform-origin: 0% 50%;
	padding-bottom: 0.35rem;
	white-space: nowrap;
	will-change: transform;
}

.oh {
	overflow: hidden;
}

.oh__inner {
	display: inline-block;
	transform-origin: 0% 50%;
	will-change: transform;
}

.frame {
	height: 100%;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
}

.frame--fixed {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: auto;
	padding: 1rem;
	z-index: 1;
	display: grid;
	grid-template-columns: 38% 62%;
}

.frame__title {
	font-size: 1rem;
	font-weight: 400;
	margin: 0 0 2rem 0;
}

.frame__links {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
}

.frame__links a {
	margin: 0 1rem 0.35rem 0;
}

.frame--fixed .frame__links {
	flex-direction: row;
}

.grid {
	display: grid;
	--grid-border-radius: 8px;
	grid-template-columns: repeat(2,50%);
}

.grid--large {
	grid-auto-rows: 32vmin;
	padding: 0.5vw;
	--grid-padding: 0.5vw;
}

.grid--mini {
	width: 220px;
	height: 190px;
	--grid-padding: 1px;
    margin-bottom: 3vh;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    position: absolute;
}

.grid__cell {
	display: grid;
	align-items: end;
}

.grid--mini .grid__cell:not(.grid__cell--current):hover .grid__cell-img {
	opacity: 0.7;
}

.grid__cell--current .grid__cell-img {
	opacity: 0.3;
}

.grid__cell--padded {
	padding: calc(var(--grid-padding) * 2 );
}

.grid__cell-img {
	width: calc(100% - var(--grid-padding) * 2);
	height: calc(100% - var(--grid-padding) * 2);
	margin: var(--grid-padding);
	border-radius: var(--grid-border-radius);
	display: block;
	position: relative;
	overflow: hidden;
}

.grid__cell-img-inner {
	background-size: cover;
	background-position: 50% 50%;
	width: 100%;
	height: 100%;
	cursor: pointer;
}

.content {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	padding: 15vh 8vw 0;
	z-index: 1000;
	pointer-events: none;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
}

.content__item {
	position: absolute;
	opacity: 0;
	display: grid;
}

.content__item--current {
	opacity: 1;
	position: relative;
	pointer-events: auto;
}

.content__item-number {
	font-weight: 600;
	display: block;
}

.content__item-heading {
	font-size: 4vw;
	line-height: 1;
	margin: 1rem 0 3rem 0;
	font-weight: 600;
}

.content__item-text {
	max-width: 30ch;
	margin-bottom: 2rem;
}

.content__item-link {
	cursor: pointer;
}

.slide-nav {
	position: fixed;
    width: 40%;
    right: 15%;
	top: 0;
	height: 100%;
	display: grid;
	align-content: space-between;
	pointer-events: none;
}

.slide-nav__img {
	width: 100%;
	height: 10vh;
	position: relative;
	overflow: hidden;
	opacity: 0.3;
	cursor: not-allowed;
}

.content--open .slide-nav__img {
	pointer-events: auto;
}

.slide-nav__img--prev {
	transform: translateY(-100%);
	border-radius: 0 0 1.5vw 1.5vw;
}

.slide-nav__img--next {
	transform: translateY(100%);
	border-radius: 1.5vw 1.5vw 0 0;
}

.slide-nav__img-inner {
	width: 100%;
	height: 100%;
	background-size: cover;
	background-position: 50% 50%;
}

.back {
	background: none;
	border: 0;
	padding: 0;
	margin: auto 0 1.5rem 0;
    opacity: 0;
    pointer-events: none;
    stroke: #000;
    z-index: 1000;
    cursor: pointer;
    width: 50px;
}

.back svg {
	stroke-linecap: round;
}

.back:hover,
.back:focus {
	outline: none;
	stroke: #823725;
}

.content--open .back {
	pointer-events: auto;
}

@media screen and (min-width: 53em) {
	.content {
		width: 38%;
	}
	.grid {
		grid-template-columns: repeat(4,25%);
	}
	.grid__cell--padded {
		padding: var(--grid-padding);
	}
	.grid__cell-c1-r1 { grid-column: 1; grid-row: 1; }
	.grid__cell-c3-r1 { grid-column: 3; grid-row: 1; }
	.grid__cell-c4-r1 { grid-column: 4; grid-row: 1; }
	.grid__cell-c1-r2 { grid-column: 1; grid-row: 2; }
	.grid__cell-c2-r2 { grid-column: 2; grid-row: 2; }
	.grid__cell-c3-r2 { grid-column: 3; grid-row: 2; }
	.grid__cell-c4-r2 { grid-column: 4; grid-row: 2; }
	.grid__cell-c2-r3 { grid-column: 2; grid-row: 3; }
	.grid__cell-c4-r3 { grid-column: 4; grid-row: 3; }
	.grid__cell-c1-r4 { grid-column: 1; grid-row: 4; }
	.grid__cell-c3-r4 { grid-column: 3; grid-row: 4; }
	.grid__cell-c3-r5 { grid-column: 3; grid-row: 5; }
	.grid--mini {
		visibility: visible;
		position: relative;
	}
	.content--open .grid--mini {
		pointer-events: auto;
	}
	body #cdawrap {
		position: relative;
		margin-top: auto;
        --cda-left: auto;
        --cda-right: auto;
        --cda-width: 300px;
        --cda-bottom: auto;
        --cda-top: auto;
        opacity: 1 !important;
        pointer-events: auto;
        z-index: 1;
    }

    body #cdawrap .cda-footer {
        display: none;
    }

    body #cdawrap .cda-text {
        color: transparent !important;
        height: 1.25rem;
        pointer-events: none;
        position: relative;
        text-align: left;
    }

    body #cdawrap .cda-text::before {
        color: var(--color-text);
        content: "Sponsored by "attr(data-sponsor);
        font-size: 0.85rem;
        font-weight: 500;
        left: 0;
        pointer-events: auto;
        position: absolute;
        top: 0;
        opacity: 0.5;
        transition: opacity 0.4s;
    }

    .grid[style*="pointer-events: none;"] .frame #cdawrap .cda-text::before {
    	opacity: 0 !important;
    }

    body #cdawrap:hover .cda-text::before {
        color: var(--color-link-hover);
    }

    body #cdawrap a::after {
        display: none;
    }
}
