/*@import url("https://fonts.googleapis.com/css2?family=Rubik:wght@400;600&display=swap");*/
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700&display=swap");

:root {
	--main-font-family: "Inter", sans-serif;

	--normal-font-weight: 400;
	--bold-font-weight: 700;

	--green-light: #30ad66;
	--green-dark: #0a7739;

	--btn-background: #1b924f
		linear-gradient(to bottom right, var(--green-light), var(--green-dark));

	--box-shadow-img: 0 0 24px rgba(0, 0, 0, 0.1);
	--box-shadow-btn: 0 0 24px -8px var(--green-dark);

	--border-radius: 16px;

	--bg-accent: rgba(110, 110, 110, 0.2);
}

.light {
	--bg: #fdfdfd;
	--text: #1a1a1a;
	--text-light: #838383;

	--code-bg: #f6f8fa;
	--code-blue: #4a86e8;
	--code-red: #cc0000;
	--code-purple: #9900ff;
	--code-yellow: #c79a66;
	--code-green: #91bc74;
	--code-comment: grey;
}

.dark {
	--bg: #141414;
	--text: #dddddd;
	--text-light: #646464;

	--code-bg: #282c34;
	--code-blue: #59afef;
	--code-red: #e06c75;
	--code-purple: #bd78dd;
	--code-yellow: #c79a66;
	--code-green: #91bc74;
	--code-comment: grey;
}
* {
	box-sizing: border-box;

	margin: 0;
}
main * + * {
	margin-top: 1em;
}
html,
body {
	margin: 0;
	background: var(--bg);
	color: var(--text);

	font-family: var(--main-font-family);
	font-weight: 400;
}

/* NADPISY */
h1,
h2,
h3,
h4,
h5,
h6 {
	margin-top: 0.2em;
	text-transform: uppercase;
	font-weight: var(--bold-font-weight);
}
h1 {
	line-height: 1.2;
}
h2,
h3,
h4,
h5,
h6 {
	line-height: 1.35;
}

h1 + h2 {
	margin-top: 0.6em;
}

p + h2,
p + h3,
p + h4,
p + h5,
p + h6,
table + h2,
table + h3,
table + h4,
table + h5,
table + h6,
ul + h2,
ul + h3,
ul + h4,
ul + h5,
ul + h6,
ol + h2,
ol + h3,
ol + h4,
ol + h5,
ol + h6,
a + h2,
a + h3,
a + h4,
a + h5,
a + h6 {
	margin-top: 1.6em;
}

/* PARAGRAFY*/
p {
	line-height: 2;
}

h2 + p,
h3 + p,
h4 + p,
h5 + p,
h6 + p {
	margin-top: 0.2em;
}

/* Odkazy */
:not(nav) a {
	color: var(--green-light);
}

:not(nav) a:visited {
	color: var(--green-light);
}

/* TEXTOVÉ CLASSKY */
.b {
	font-weight: var(--bold-font-weight);
}
.i {
	font-style: italic;
}
.u {
	text-decoration: underline;
}
.n {
	font-weight: var(--normal-font-weight);
}

.center {
	text-align: center;
}
.left {
	text-align: left;
}
.right {
	text-align: right;
}

.upper {
	text-transform: uppercase;
}
.low {
	text-transform: lowercase;
}

code,
.code {
	font-family: "Consolas", "Courier New", Courier, monospace;
	font-variant-ligatures: none;
	font-size: 1.1em;
	line-height: 1.4;

	transition: color 500ms, background-color 500ms;
}

.light code,
.light .code {
	font-weight: 600;
}

code {
	display: block;
	padding: 1.2em;
	background-color: var(--code-bg);
	border-radius: var(--border-radius);
}

code .b,
.code .b {
	color: var(--code-blue);
	font-weight: var(--normal-font-weight);
}

code .r,
.code .r {
	color: var(--code-red);
}

code .p,
.code .p {
	color: var(--code-purple);
}

code .y,
.code .y {
	color: var(--code-yellow);
}

code .g,
.code .g {
	color: var(--code-green);
}

code .comment,
.code .comment {
	color: var(--code-comment);
}

/* NAVIGACE nad zápisem */
body > nav {
	margin: 0 auto;
	padding: 2em;
	padding-bottom: 0;
	max-width: 70ch;
	text-transform: uppercase;
}

/* ODKAZ V NAVIGACI */
nav a {
	display: inline-flex;
	align-items: center;
	gap: 8px;

	color: white;
	background: var(--btn-background);

	line-height: 1.3;
	text-decoration: none;
	font-weight: 500;

	padding: 8px 16px;

	margin: 8px 0;
	margin-right: 8px;

	border-radius: var(--border-radius);

	box-shadow: var(--box-shadow-btn);
}

nav a:visited {
	color: white;
}

nav a.disabled {
	background: linear-gradient(to bottom right, #cccccc, #afafaf);
	opacity: 0.3;
	cursor: default;
	box-shadow: none;
}

/* WORK IN PROGRESS LINK */
nav a.wip {
	background: linear-gradient(to bottom right, #ca8012, #884107);
	box-shadow: none;
}
nav a > * {
	margin: 0;
	line-height: 1;
}
nav a .num {
	display: inline-flex;
	justify-content: center;
	align-items: center;

	background-color: rgba(0, 0, 0, 0.25);
	margin-top: -6px;
	margin-bottom: -6px;
	margin-left: -8px;
	width: 1.65rem;
	height: 1.65rem;
	padding: 5px 4px 4px;
	font-size: 0.8em;
	border-radius: 50%;
}

/* MAIN (to je to kde jsou ty zápisy už) */
main {
	line-height: 1.7;
	margin: 0 auto;
	padding: 2em 2em 8em;
	max-width: 70ch;
}

/* IMG */
main > img {
	width: 100%;
	display: block;
	margin: 1em auto 2em;

	border-radius: var(--border-radius);
	box-shadow: var(--box-shadow-img);
}

main img.half {
	width: 50%;
	margin: 1em auto 1em;
}

.dark img.invertable {
	filter: invert(1);
}

/* LISTY */
main > ul,
main > ol {
	margin-top: 0.2em;
}
main > ul > * + li,
main > ol > * + li {
	margin-top: 0.4em;
}
ul ul,
ul ul li,
ol ol,
ol ol li,
ol ul,
ol ul li {
	margin-top: 0;
}

body > div:last-child {
	display: none;
}

ul.hide-style,
ol.hide-style {
	list-style: none;
}

/* TABLE */
table {
	border-collapse: collapse;
}

th,
td {
	padding: 0.8em;
	border: 1px solid var(--text-light);
	border-radius: 0 !important;
}

/* THEME SWITCHER (přepínař dark modu) */
#theme-switcher {
	z-index: 1000;
	position: absolute;
	top: 1em;
	right: 1em;
	width: 2em;
	height: 2em;
	background-color: var(--text);
	border-radius: 50%;
	cursor: pointer;
}

.light #theme-switcher {
	background: #252525;
	box-shadow: 0 0 8px #000000;
}
.dark #theme-switcher {
	background: #ebd472;
	box-shadow: 0 0 16px #fad048;
}

#scroll-up {
	z-index: 1000;
	position: fixed;
	bottom: 1em;
	right: 1em;
	width: 2em;
	height: 2em;

	display: grid;
	place-items: center;

	color: var(--bg);
	background-color: var(--text);
	border-radius: 50%;
	cursor: pointer;
	opacity: 0.6;

	transition: opacity 300ms ease-in-out;
}

#scroll-up.hidden {
	opacity: 0;
}

.cards-flex {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
}

.img-card {
	width: 100%;
	display: grid;
	grid-template-columns: 1fr;
	grid-template-rows: auto 1fr;

	margin-top: 0;

	border-radius: var(--border-radius);
	overflow: hidden;
	box-shadow: var(--box-shadow-img);
}

.img-card img {
	width: 100%;
	object-fit: cover;
}

.img-card .img-card-text {
	background-color: var(--bg-accent);
	margin: 0;
	padding: 24px;
	padding-left: 32px;

	font-size: 14px;
}

.img-card .img-card-text .header {
	font-size: 1.4em;
	font-weight: var(--bold-font-weight);
	line-height: 1.2;
}

.img-card .img-card-text ul {
	padding-left: 1em;
	margin-top: 0.4em;
}
.img-card .img-card-text li {
	margin-top: 0;
}

.img-card.large {
	grid-column: 1 / span 2;
}

.img-card.horizontal {
	grid-column: 1 / span 2;
	grid-template-columns: 1fr 1fr;
	grid-template-rows: 1fr;
}
.img-card.horizontal .img-card-text {
	display: flex;
	flex-flow: column;
	justify-content: center;
}

@media screen and (max-width: 750px) {
	.cards-flex {
		grid-template-columns: 1fr;
	}
	.img-card .img-card-text {
		padding: 24px;
	}

	.img-card.large {
		grid-column: 1 / span 1;
	}
	.img-card.horizontal {
		grid-column: 1 / span 1;
		grid-template-columns: 1fr;
		grid-template-rows: auto 1fr;
	}

	table {
		font-size: 0.7em;
		display: inline-table;
		width: 100%;
		overflow: hidden;
	}

	.code,
	code {
		font-size: 0.8em;
	}
}

audio {
	width: 100%;
}
