/* Variables
/* ---------------------------------------------------------- */

:root {
  --color-primary: #eb1e39;
  --color-text-on-primary: rgb(250, 250, 250);
  --color-primary-text: #272828;
  --color-background: rgb(250, 250, 250);
  --color-secondary-background: #fff;
  --color-code-background: #fff;
  --color-code-text: #eb1e39;

  --font-sans: "Open Sans", "Lato", sans-serif;
  --font-mono: Menlo, Monaco, Consolas, "Courier New", monospace;
  --font-base-size: 12pt;

  --breakpoint-mid-width: 800px;

  --grid-column-template-main: 1fr 1fr minmax(1rem, 800px) 1fr 1fr;

  --border-code: 1px solid #ddd;

  --shadow-default: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
}

body[data-theme="dark"] {
  --color-primary-text: rgb(250, 250, 250);
  --color-background: #272828;
  --color-secondary-background: #212221;
  --color-code-background: #333;
  --border-code: none;
}

/* Resets
/* ---------------------------------------------------------- */

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

* {
  margin: 0;
  padding: 0;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  height: auto;
  max-width: 100%;
}

iframe {
  display: block;
}

input,
button,
textarea,
select {
  font: inherit;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
  line-height: 1.8;
  margin: 0 0 0.75rem;
}


/* Globals
/* ---------------------------------------------------------- */

html {
  font-size: var(--font-base-size);
}

@media only screen and (max-width: 399px) {
  html {
    font-size: 10pt;
  }
}

@media only screen and (min-width: 399px) and (max-width: 799px) {
  html {
    font-size: 11pt;
  }
}

body {
  font-family: var(--font-sans);
  background-color: var(--color-background);
  color: var(--color-primary-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--color-primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

hr {
  width: 100%;
  border: 0;
  border-top: 1px solid #9e9e9e;
}

ol, ul {
  list-style-position: inside;
}

/* Main Layout
/* ---------------------------------------------------------- */

.main-layout {
  display: grid;
  grid-gap: 10px 10px;
  grid-template-columns: var(--grid-column-template-main);
}

.main-layout > * {
  grid-column: 3 / -3;
}

/* Header
/* ---------------------------------------------------------- */

.header {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex-wrap: wrap;
  align-content: center;
  align-items: center;
}

.header h1 {
  margin: 0;
  padding: 0;
  font-size: 2.5rem;
  line-height: normal;
}

.header h3 {
  font-size: 1.4rem;
  font-weight: normal;
  line-height: normal;
}

.header > .logo {
  margin: 0 auto;
  padding: 1rem 0;
  max-width: var(--breakpoint-mid-width);
  text-align: center;
}

.header > .logo > a {
  color: var(--color-primary-text);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.header > .logo > a:hover {
  color: var(--color-primary);
  text-decoration: none;
}

.header > .logo > a > svg {
  margin-bottom: 1rem;
  display: flex;
  width: 96px;
  fill: var(--color-primary-text);
}

/* Navigation
/* ---------------------------------------------------------- */

.navbar {
  width: 100%;
  max-width: var(--breakpoint-mid-width);
  min-height: 44px;
  line-height: 44px;
  color: var(--color-primary);
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: space-evenly;
  align-items: center;
  font-weight: bold;
  font-size: 1.25rem;
}

.navbar > a {
  margin: 0.5rem 1rem;
}

.navbar > a:hover {
  color: var(--color-primary-text);
  text-decoration: none;
}

.navbar-icon {
  width: 1.25rem;
  height: 1.25rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

.navbar-icon > svg {
  width: 100%;
  height: 100%;
}

/* Footer
/* ---------------------------------------------------------- */

.footer {
  height: 64px;
  line-height: 64px;
  margin-top: 1rem;
  font-size: 1rem;
  display: flex;
  justify-content: center;
}

/* Pagination
/* ---------------------------------------------------------- */

.pagination {
  background-color: var(--color-primary);
  height: 48px;
  line-height: 48px;
  margin-bottom: 1rem;
  font-size: 1rem;
  text-align: center;
  color: var(--color-text-on-primary);
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: center;
  box-sizing: border-box;
}

.pagination > .page-number {
  grid-column: 2 / span 1;
  justify-self: center;
}

.pagination > .newer-posts {
  grid-column: 1 / span 1;
  justify-self: start;
}

.pagination > .older-posts {
  grid-column: 3 / span 1;
  justify-self: end;
}

.pagination > .pager {
  background: var(--color-primary);
  color: var(--color-text-on-primary);
  font-weight: bold;
  text-transform: uppercase;
  max-width: 100px;
  padding: 0 5px;
  box-sizing: content-box;
}

.pagination > .pager:hover {
  filter: brightness(0.8);
}

/* Post list
/* ---------------------------------------------------------- */

.post-card {
  margin: 4rem 0;
  width: 100%;
  overflow: hidden;
  background-color: var(--color-secondary-background);
  border-radius: 6px;
  box-shadow: var(--shadow-default);
  text-align: left;
}

@media only screen and (max-width: 799px) {
  .post-card  {
    margin: 2rem 0;
  }
}

.feature-image {
  width: 100%;
  height: auto;
  max-height: 600px;
  margin: 0 auto;
  object-fit: cover;
  grid-column: 1 / -1 !important;
}

.post-card-info {
  margin: 0;
  padding: 1rem;
}

.post-card-title {
  display: block;
  margin: 1rem 0;
  font-size: 2rem;
}

.post-card-title h1 {
  line-height: 1.3;
}

.post-card-title a {
  color: var(--color-primary-text);
}

.post-card-title a:hover {
  color: var(--color-primary);
  text-decoration: none;
}

.post-card-meta-time {
  color: var(--color-primary);
  font-size: 1rem;
  font-weight: bold;
  display: block;
}

.post-card-expert {
  font-size: 1.1rem;
}

.post-card-expert a {
  margin-left: 10px;
  color: var(--color-primary);
}

.post-card-expert a:hover {
  color: var(--color-primary-text);
  text-decoration: none;
}

.post-card-tags {
  margin-top: 1rem;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 12px;
}

.post-card-tag {
  font-size: 1rem;
  padding: 5px 10px;
  background-color: var(--color-primary);
  color: var(--color-text-on-primary);
  transition: transform 0.2s ease;
  border-radius: 6px;
}

.post-card-tag:hover {
  text-decoration: none;
  transform: translateY(-5px);
}

/* Post
/* ---------------------------------------------------------- */

.post {
  margin: 4rem 0 1rem 0;
  grid-column: 1 / -1 !important;
}

.post-feature-image {
  width: 100%;
  height: auto;
  max-height: 600px;
  margin: 0 auto;
  object-fit: contain;
}

.post-header {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  align-content: center;
  justify-content: center;
  align-items: center;
  font-size: 2rem;
}

.post-title {
  text-align: center;
  margin: 1.25rem 0;
  font-size: 3rem;
  line-height: 1.3;
}

.post-meta-separator {
  width: 200px;
}

.post-meta-time {
  text-align: center;
  color: var(--color-primary-text);
  font-size: 1rem;
  display: block;
  margin: 1.25rem 0;
}

.post-content {
  grid-column: 1 / -1 !important; /* Make post content full width inside inside a parent grind from main-layout*/
  display: grid;  /* Create a new  grid for post content */
  grid-gap: 10px 10px;
  grid-template-columns: var(--grid-column-template-main);
  padding: 1rem 0 0 0;
  font-size: 1.25rem;
}

.post-content > * {
  grid-column: 3 / -3 !important;
}

.post-content > h1 {
  margin: 2rem 0 0.5rem 0;
  font-size: 2rem;
}

.post-content > h2 {
  margin: 2rem 0 0.5rem 0;
  font-size: 1.75rem;
}

.post-content > h3 {
  margin: 2rem 0 0.5rem 0;
  font-size: 1.5rem;
}

/* Blockquote
/* ---------------------------------------------------------- */
blockquote {
  margin: 1rem 0;
  padding: 0.75rem 1.5rem;
  width: 100%;
  box-sizing: border-box;
  border-left: 8px solid var(--color-primary);
  background-color: var(--color-background);
  box-shadow: var(--shadow-default);
  font-size: 1.2rem;
  font-style: italic;
}

.kg-blockquote-alt {
  border-left: 8px solid var(--color-primary);
  border-right: 8px solid var(--color-primary);
  font-size: 1.2rem !important;
  padding: 0.75rem 1.5rem !important; 
}

/* Cards
/* ---------------------------------------------------------- */

.kg-width-wide, .kg-content-wide > div {
  grid-column: 2 / -2 !important;
}

.kg-width-full {
  grid-column: 1 / -1 !important;
}

/* Image */

.kg-image {
  margin: 0.5rem auto;
}

.kg-image-card {
  margin: 0.5rem 0;
}

.kg-image-card > figcaption {
  padding: 0;
}

figcaption {
  padding: 0.5rem;
  text-align: center;
  font-size: 0.8rem;
}

/* Video */
video {
  margin: 0 auto;
}

/* Bookmark */
.kg-bookmark-card .kg-bookmark-container {
  margin: 1rem 0;
  border-radius: 0.25em !important;
  background-color: var(--color-background);
  box-shadow: var(--shadow-default);
}

.kg-bookmark-card .kg-bookmark-container:hover {
  transform: translateY(-10px);
}

.kg-bookmark-card .kg-bookmark-content {
  padding: 1.15em;
}

.kg-bookmark-card .kg-bookmark-title {
  font-size: 0.9em;
}

.kg-bookmark-card .kg-bookmark-description {
  max-height: none;
  margin-top: 0.3em;
  font-size: 0.8em;
}

.kg-bookmark-card .kg-bookmark-metadata {
  font-size: 0.8em;
}

.kg-bookmark-card .kg-bookmark-thumbnail img {
  border-radius: 0 0.2em 0.2em 0;
}

/* Embed */

.kg-embed-card {
  margin: 1rem 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

/* Product */

.kg-product-card.kg-card .kg-product-card-image {
  margin-bottom: 12px;
}

.kg-product-card.kg-card a.kg-product-card-button {
  height: 2.8em;
  margin-top: 12px;
}

/* Callout */

.kg-callout-card {
  border-radius: 6px !important;
}

/* Toggle card */
.kg-toggle-card {
  background-color: var(--color-code-background) !important;
}

/* Code */
/* ---------------------------------------------------------- */
code,
kbd,
pre,
samp {
  font-family: var(--font-mono);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

code {
  border: var( --border-code);
  border-radius: 4px;
  background-clip: padding-box;
  background-color: var(--color-code-background);
  color: var(--color-code-text);
  font-size: 1rem;
  padding: 4px 10px; 
}

code a > & {
  color: inherit;
}

pre {
  overflow: auto;
  box-sizing: border-box;
  width: 100%;
  margin: 0.5rem 0 1.5rem 0;
  border-radius: 6px;
  box-shadow: var(--shadow-default);
  background-color: var(--color-code-background);
}

pre > code {
  color: inherit;
  border: none;
  font-weight: normal;
  width: 100%;
}

.hljs {
  width: 100%;
  padding: 1rem;
}

/* Comments
/* ---------------------------------------------------------- */

.comments {
  margin: 3rem 0 1rem 0;
  max-width: var(--breakpoint-mid-width);
}

.comments-header {
  text-align: center;
}

.comments-header > h1 {
  margin: 0;
  font-size: 2rem;
}

.comments-header > span {
  font-size: 1.25rem;
}

.comments-disqus {
  margin: 0 auto;
  padding: 20px;
  background-color: var(--color-background);
}

/* Tags
/* ---------------------------------------------------------- */

.tag-list {
  display: inline;
}

.post-tags-list {
  margin: 0 auto;
  padding: 0;
  height: 100%;
  width: 100%;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
}

.tag {
  font-size: 1rem;
  margin: 10px;
  padding: 10px 10px 10px;
  background-clip: padding-box;
  background-color: var(--color-code-background);
  color: var(--color-code-text);
  border:var(--border-code);
  border-radius: 10px;
  transition: transform .2s ease;
}

.tag:hover {
  text-decoration: none;
  transform: translateY(-5px);
}

/* Cookie notice
/* ---------------------------------------------------------- */

#cookie-notice {
  color: #fff;
  background-color: #718daa;
  max-width: 300px;
  position: fixed;
  bottom: 10px;
  right: 10px;
  margin: 0px;
  padding: 20px;
  box-shadow: var(--shadow-default);
  border-radius: 6px;
  font-size: 1rem;
  text-align: left;
  z-index: 1000000;
  visibility: hidden;
}

#cookie-notice > button {
  color: inherit;
  background: #0077b5;
  border: 0;
  border-radius: 6px;
  padding: 8px;
  width: 100%;
  cursor: pointer;
}

#cookie-notice > button:hover {
  filter: brightness(0.8);
}

/* Error
/* ---------------------------------------------------------- */

.error-message {
  width: 100%;
  height: 100%;
  min-height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.error-message > a {
  margin: 1rem 0;
} 

.error-icon {
  fill: var(--color-text-on-primary);
  height: 40vh;
  margin: 3rem auto;
}