@import "reset.css";

:root {
	
	/* colors */
	--black: #1a171b;
	--white: #fff;
	--primary: #a50231;
	--dark-grey: #aba98f;
	--medium-grey: #c0beb4;
	--light-grey: #cbcac3;
	--subtle-grey: #e4e3e1;
	
	/* paddings */
	--mobile-padding: 1rem;
	--desktop-padding: 2rem;
	
}

/* @group FONTS */

@font-face {
    font-family: 'Noto Sans';
    src: url('../fonts/notosans-regular-webfont.woff2') format('woff2'),
         url('../fonts/notosans-regular-webfont.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Noto Sans';
    src: url('../fonts/notosans-italic-webfont.woff2') format('woff2'),
         url('../fonts/notosans-italic-webfont.woff') format('woff');
    font-weight: normal;
    font-style: italic;
}

@font-face {
    font-family: 'Noto Sans';
    src: url('../fonts/notosans-medium-webfont.woff2') format('woff2'),
         url('../fonts/notosans-medium-webfont.woff') format('woff');
    font-weight: 500;
    font-style: normal;
}

@font-face {
    font-family: 'Noto Sans';
    src: url('../fonts/notosans-mediumitalic-webfont.woff2') format('woff2'),
         url('../fonts/notosans-mediumitalic-webfont.woff') format('woff');
    font-weight: 500;
    font-style: italic;
}

@font-face {
    font-family: 'Noto Sans';
    src: url('../fonts/notosans-bold-webfont.woff2') format('woff2'),
         url('../fonts/notosans-bold-webfont.woff') format('woff');
    font-weight: bold;
    font-style: normal;
}

@font-face {
    font-family: 'Noto Sans';
    src: url('../fonts/notosans-bolditalic-webfont.woff2') format('woff2'),
         url('../fonts/notosans-bolditalic-webfont.woff') format('woff');
    font-weight: bold;
    font-style: italic;
}

/* @end */

/* @group GENERAL */

html,
body {
	font-family: 'Noto Sans', Helvetica, Arial, sans-serif;
	font-size: 17px;
	line-height: 1.5em;
}

.text-uppercase,
.breadcrumb,
.tags,
.footer {
	font-size: 16px;
	text-transform: uppercase;
	letter-spacing: .05em;
}

.sidebar__copyright {
	font-size: .8rem;
	line-height: 1.3em;
}

em {
	font-size: 1.05em;
	font-style: italic;
}

.breadcrumb {
	font-weight: 500;
}

h1 {
	font-size: 2.8rem;
	line-height: 1.1em;
}

	@media (max-width: 699px) {
		
		h1 {
			hyphens: auto;
		}
		
	}
	
	@media (min-width: 700px) {
		
		.cover,
		.text {
			font-size: 21px;
			line-height: 1.5em;
		}
		
		.text .footnotes-container {
			font-size: 17px;
			line-height: 1.5em;
		}
		
	}

	@media (min-width: 1200px) {
		
		h1 {
			font-size: 3.8rem;
			line-height: 1.1em;
		}
		
		.cover > *:nth-child(n+6) h1 {
			font-size: 2.8rem;
			line-height: 1.1em;
		}
		
	}

strong,
h2,
h3 {
	font-weight: bold;
	font-size: 1.1em;
}

.kt h2 {
	margin-bottom: .75em;
}

p:not(:last-child) {
	margin-bottom: .75em;
}

.text-uppercase {
	margin-top: 1.5em;
}

.kt a {
	text-decoration: underline;
	text-decoration-color: var(--medium-grey);
}

.kt a:hover {
	text-decoration-color: var(--primary);
}

.breadcrumb a:hover,
.switch a:hover,
.text-uppercase a:hover,
.tags a:hover {
	text-decoration: underline;
}

h2 a:hover {
	text-decoration: underline;
}

.kt ul:not(:last-child) {
	margin-bottom: 1em;
}

.kt p + ul {
	margin-top: -.25em;
}

.kt li {
	display: table;
}

.kt li:not(:last-child) {
	margin-bottom: .75em;
}

	.kt ul li::before {
		content: "–";
		display: table-cell;
		width: 1em;
	}
	
.kt ol {
	counter-reset: counter;
}

	.kt ol > li {
		counter-increment: counter;
	}
	
	.kt ol > li::before {
		content: counter(counter)". ";
		display: table-cell;
		width: min-content;
		padding-right: .5em;
	}
	
sup,
sub {
   position: relative;
	 margin-left: .1em;
	 font-size: .8em;
	 vertical-align: baseline;
}

sup {
	top: -0.4em;
}

sub {
	top: 0.4em;
}

figure,
img {
	max-width: 100%;
	height: auto;
}

.excerpt {
	max-width: 36rem;
}

/* @end */

/* @group LAYOUT */

html,
body {
	min-width: 320px;
	min-height: 100vh;
	scroll-behavior: smooth;
}

.wrap {
	max-width: 1400px;
	margin-right: auto;
	margin-left: auto;
}

	@media (max-width: 699px) {
		
		.wrap,
		.header,
		.footer,
		.breadcrumb,
		.page-header,
		.category-grid,
		.articles-grid,
		.article-grid__header,
		.article-grid__sidebar,
		.article-grid__content,
		.authors,
		.switch > * {
			padding-right: var(--mobile-padding);
			padding-left: var(--mobile-padding);
		}
		
	}
	
	@media (min-width: 700px) {
		
		.wrap,
		.header,
		.footer,
		.breadcrumb,
		.page-header,
		.category-grid,
		.articles-grid,
		.article-grid__header,
		.article-grid__sidebar,
		.article-grid__content,
		.authors,
		.switch > * {
			padding-right: var(--desktop-padding);
			padding-left: var(--desktop-padding);
		}
		
	}

/* @end */

/* @group body-grid */

.body-grid {
	display: grid;
	grid-template-rows: min-content 1fr min-content;
}

/* @end */

/* @group header */

.header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding-top: 1rem;
	padding-right: 1rem;
	padding-bottom: 1rem;
	background-color: var(--medium-grey);
	color: var(--primary);
	font-size: 48px;
	line-height: 1em;
}
	
	.header__title {
		position: relative;
		top: .1em;
	}

		.header__title sup {
			position: relative;
		  vertical-align: baseline;
		  top: -0.5em;
			left: -.25em;
			font-weight: 500;
			font-size: .666666666em;
		}

	.header__logo {
		opacity: .5;
	}
	
		.header__logo img {
			height: 60px;
			width: auto;
		}
		
	@media (max-width: 360px) {
		
		.header {
			font-size: 40px;
		}
		
	}

/* @end */

/* @group main */

.main {
	background-color: var(--medium-grey);
}

/* @end */

/* @group cover */

.cover {
	background-color: var(--medium-grey);
	color: var(--white);
}

	@media (min-width: 900px) {
		
		.cover {
			display: grid;
			grid-auto-flow: row;
			grid-template-columns: repeat(12, 1fr);
			min-height: calc(100vh - 60px - 2rem - 48px);
		}
		
			.cover > *:nth-child(1) {
				grid-column: 1 / span 5;
			}
			
			.cover > *:nth-child(2) {
				grid-column: 1 / span 5;
				grid-row: 2;
			}
			
			.cover > *:nth-child(3) {
				grid-column: 6 / span 4;
				grid-row: 1 / span 2;
			}
			
			.cover > *:nth-child(4) {
				grid-column: 1 / span 9;
				grid-row: 3;
			}
			
			.cover > *:nth-child(5) {
				grid-column: 10 / span 3;
				grid-row: 1 / span 3;
			}
		
			.cover > *:nth-child(n+6) {
				grid-column: span 4;
			}
			
			.cover > *:nth-child(3n+6):last-child {
				grid-column: span 12;
			}
			
			.cover > *:nth-child(3n+7):last-child {
				grid-column: span 8;
			}
			
			/* layout from 1 to 4 sections */
			
			.cover--1-sections > * {
				grid-column: span 12;
			}
			
			.cover--2-sections > * {
				grid-column: span 6;
			}
		
			.cover--3-sections > *:nth-child(1),
			.cover--4-sections > *:nth-child(1) {
				grid-column: 1 / span 7;
				grid-row: 1;
			}
			
			.cover--3-sections > *:nth-child(2),
			.cover--4-sections > *:nth-child(2) {
				grid-column: 1 / span 7;
				grid-row: 2;
			}
			
			.cover--3-sections > *:nth-child(3),
			.cover--4-sections > *:nth-child(3) {
				grid-column: 8 / span 5;
				grid-row: 1 / span 2;
			}
			
			.cover--4-sections > *:nth-child(4) {
				grid-column: 1 / span 12;
				grid-row: 3;
			}
				
	}

/* @end */

/* @group cover-section */

.cover-section {
	display: flex;
  flex-direction: column;
}

.cover-section--archived {
	background-color: var(--dark-grey) !important;
}
	
		.cover-section__header h1 {
			margin-bottom: var(--desktop-padding);
		}
		
	.cover-section__main {
		max-width: 36em;
	}

	.cover-section__footer {
		margin-top: auto; /* important for alignment at bottom */
		padding-top: 1rem;
		text-align: right;
	}

	@media (max-width: 999px) {
		
		.cover-section {
			padding: var(--mobile-padding);
		}
	}
	
	@media (min-width: 1000px) {
		
		.cover-section {
			padding: var(--desktop-padding) var(--desktop-padding) var(--mobile-padding) var(--desktop-padding);
		}
	}

/* @end */

/* @group archive */

.archive {
	background-color: var(--dark-grey);
	color: white;
}

/* @end */

/* @group archive-section */

.archive-section {
	padding-top: 1rem;
}

.archive-section:last-child {
	padding-bottom: 1rem;
}

	.archive-section h1 {
		margin-bottom: unset;
		font-size: 1.1rem;
		font-weight: bold;
		line-height: 1.5em;
	}
	
	.archive-section__footer {
		margin-top: unset;
	}

	@media (max-width: 999px) {
		
		.archive-section {
			padding-right: var(--mobile-padding);
			padding-left: var(--mobile-padding);
		}
	}
	
	@media (min-width: 1000px) {
		
		.archive-section {
			padding-right: var(--desktop-padding);
			padding-left: var(--desktop-padding);
		}
	}

/* @end */

/* @group breadcrumb */

.breadcrumb {
	padding-top: .75rem;
	padding-bottom: .75rem;
	background-color: var(--primary);
	color: var(--white);
}

/* @end */

/* @group category-grid */

.category-grid {
	display: grid;
	grid-gap: 3rem;
	padding-top: 3rem;
	padding-bottom: 3rem;
	background-color: var(--white);
}

	@media (min-width: 700px) {
		
		.category-grid {
			grid-gap: 4rem;
			grid-template-columns: 1fr 1fr;
			padding-top: 4rem;
			padding-bottom: 4rem;
		}
		
	}

/* @end */

/* @group articles-grid */

.articles-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 30em), 1fr));
	grid-column-gap: 3rem;
	grid-row-gap: 2rem;
	padding-top: 3rem;
	padding-bottom: 3rem;
	background-color: var(--white);
}

/* @end */

/* @group article-grid */

.article-grid {
	display: grid;
}
	
	.article-grid__content {
		padding-top: 2rem;
		padding-bottom: 2rem;
	}
	
	.article-grid__sidebar {
		background-color: var(--subtle-grey);
	}
	
	@media screen and (min-width: 1000px) {
		
		.article-grid {
			grid-template-columns: minmax(18rem, 1fr) 3fr;
			grid-template-rows: min-content 1fr;
		}
		
			.article-grid__header,
			.article-grid__content {
				padding-left: 3rem;
			}
		
			.article-grid__header {
				grid-column: 2;
			}
			
			.article-grid__content {
				grid-column: 2;
				padding-top: 3rem;
				padding-bottom: 3rem;
			}
			
			.article-grid__sidebar {
				grid-column: 1;
				grid-row: 1 / span 2;
			}
		
	}
	
	@media screen and (min-width: 1200px) {
		
			.article-grid__header,
			.article-grid__content {
				padding-left: 4rem;
			}
		
	}

/* @end */

/* @group content-grid */

.content-grid {
	display: grid;
	grid-column-gap: 3rem;
	grid-row-gap: 2rem;
}

.content-grid {
	margin-bottom: 3rem;
}

	@media screen and (min-width: 1200px) {
		
		.content-grid {
			grid-template-columns: 3fr minmax(11rem, 1fr);
		}
		
		.text,
		.identifier,
		.tags {
			max-width: 800px;
		}
	}

/* @end */

/* @group page-header */

.page-header {
	padding-top: 2rem;
	padding-bottom: 2rem;
}

.page-header:not(.page-header--transparent) {
	background-color: var(--primary);
	color: var(--white);
}

.page-header--transparent h1 {
	color: var(--primary);
}

	.article-grid .page-header h1 {
		max-width: 11em;
	}
	
	.page-header h1 + p {
		margin-top: 1.5rem;
	}
	
	@media (min-width: 1000px) {
		
		.page-header {
			padding-top: 3rem;
			padding-bottom: 3rem;
		}
		
	}

/* @end */

/* @group text */

.text {
	
}

	.text h2 {
		margin-bottom: 1em;
		font-size: 1.25em;
		font-weight: normal;
		line-height: 1.4em;
	}
	
	.text h2:not(:first-child) {
		margin-top: 2em;
	}
	
	.text h3 {
		margin-top: 1.5em;
		margin-bottom: .75em;
	}

	.text figure {
		margin-bottom: 1.5em;
	}

	.text figcaption {
		margin-top: .5em;
		font-size: 1rem;
		line-height: 1.5em;
	}
	
	.text p:not(:last-child) {
		margin-bottom: 1em;
	}
	
	.text hr {
		height: 2px;
		margin-top: 1.5rem;
		margin-bottom: 1.5rem;
		background-color: var(--subtle-grey);
	}
	
	/*
	.text figure[class*="video"] {
	    position: relative;
	    padding-bottom: 56.25%;
	    height: 0;
	}
	
		.text figure[class*="video"] iframe {
		    position: absolute;
		    top: 0; left: 0;
		    width: 100%; height: 100%;
		}
		
		.text figure[class*="video"] figcaption {
			top: 100%;
		}
		
	*/
	
	.text figure.video video {
		max-width: 100%;
		height: auto;
	}

/* @end */

/* @group sidebar */

.sidebar {
	padding-top: 2rem;
	padding-bottom: 2rem;
}

	.sidebar__author:not(:last-child) {
		margin-bottom: 3rem;
	}

	.sidebar__figure {
		position: relative;
		max-width: 400px;
		margin-bottom: 1rem;
	}
	
		.sidebar__figure img {
			width: 100%;
		}
	
	.sidebar__copyright {
		position: absolute;
		right: 0;
		bottom: 0;
		padding: .2em .5em;
		background-color: rgba(0,0,0,.7);
		color: var(--subtle-grey);
	}
	
	@media (min-width: 1000px) {
		
		.sidebar {
			padding-top: 3rem;
			padding-bottom: 3rem;
		}
		
	}

/* @end */

/* @group authors and author*/

.authors {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 20em), 1fr));
	background-color: var(--subtle-grey);
	grid-column-gap: 2rem;
	grid-row-gap: 2rem;
	padding-top: 3rem;
	padding-bottom: 4rem;
}

.author {
	display: grid;
	grid-template-columns: 6rem 1fr;
	grid-column-gap: 1rem;
}

/* @end */

/* @group switch */

.switch {
	display: grid;
	background-color: var(--primary);
	color: var(--white);
}

	.switch > * {
		padding-top: var(--mobile-padding);
	}
	
	.switch--colored > *,
	.switch > *:last-child {
		padding-bottom: var(--mobile-padding);
	}
	
	
	@media (min-width: 700px) {
		
		.switch {
			grid-template-columns: 1fr 1fr;
		}
		
			.switch__prev {
				grid-column: 1;
			}
		
			.switch__next {
				grid-column: 2;
			}
		
			.switch__all {
				grid-column: 1 / span 2;
			}
			
	}

/* @end */

/* @group tags */

	.tags__item {
		padding-left: 1em;
		text-indent: -1em;
	}

/* @end */

/* @group footnotes */

sup.footnote {
	
}

	sup.footnote a {
		
	}

.footnotes-container {
	margin-top: 2rem;
	overflow-wrap: break-word;
  word-break: break-word;
}

.footnotes-list {
	
}

	ol.footnotes-list li:not(:last-child) {
		margin-bottom: .5em;
	}

	ol.footnotes-list li::before {
		content: counter(counter);
		width: 1.5em;
		min-width: min-content;
		padding-right: .25em;
	}
	
.footnotereverse {
	
}
	
	.footnotereverse a {
		color: var(--primary);
		text-decoration: none;
	}
	
	.footnotereverse a:hover {
		color: var(--black);
	}

/* @end */

/* @group references */

.references,
.identifier {
	border-top: 2px solid var(--subtle-grey);
	margin-top: 2rem;
	padding-top: 1rem;
}

/* @end */

/* @group footer */

.footer {
	padding-top: .5em;
	padding-bottom: .5em;
	background-color: var(--medium-grey);
	color: var(--white);
	font-weight: 500;
	text-align: right;
	line-height: 1em;
}

	.footer a {
		display: inline-block;
		margin-top: .5em;
		margin-bottom: .5em;
		margin-left: 1em;
	}
	
	.footer a:hover {
		text-decoration: underline;
	}
	
	.footer a.active {
		opacity: .5;
	}
	
	@media (max-width: 800px) {
		
		.footer {
			padding-bottom: 2em;
		}
		
	}

/* @end */