:root {
  --light-primary-color: #3c5635;
  --light-secondary-color: #adee99;
  --light-secondary-color-hover: #517049;
  --header-bg-color: #3048295c;
  --light-bg-color: #2f3e2b;
  --dark-primary-color: #23311f;
  --dark-secondary-color: #1b2618;
  --gradient-color: linear-gradient(#00000061, #00000061);
}

* {
  padding: 0;
  margin: 0;
}

body {
  font-size: 16px;
}

/* common elements */

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

a:hover {
  color: var(--light-secondary-color-hover);
}

li {
  margin: 0px 0px 0px 15px;
}

img {
  border-radius: 10px;
  max-width: 95%;
}

blockquote {
  padding: 10px;
  margin: 0 10px 0 0;
  border-left: 10px solid var(--light-secondary-color);
  background-color: var(--light-primary-color);
}

pre {
  border-left: 3px solid var(--light-secondary-color);
  background-color: var(--light-primary-color);
  page-break-inside: avoid;
  font-family: monospace;
  line-height: 1.6;
  overflow: auto;
  padding: 1em 1.5em;
  display: block;
  word-wrap: break-word;
  margin: 0 10px 0 0;
  font-size: 14px;
}

code {
  font: monospace;
  font-size: 14px;
  /* add some background color to this */
}

table {
  width: fit-content;
  border-collapse: collapse;
}

th, td {
  padding: 5px 5px;
  text-align: left;
  border: 1px solid #979797;
}

th {
  background-color: var(--light-secondary-color-hover);
  font-weight: bold;
}

tr:hover {
  background-color: var(--light-primary-color);
}

hr {
  border: none;
  height: 1px;
  background: var(--light-secondary-color);
  margin: 0px 0;
  width: 80%;
  margin-left: auto;
  margin-right: auto;
}
/* main */

.page-wrapper {
  color: #fff;
  background-color: var(--light-bg-color);
  font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
}

/* header */

.header {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  background-color: var(--header-bg-color);
  gap: 10px;
  margin: 0px 0px 0px 0px;
  padding: 5px 0 10px 0;
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
  backdrop-filter: blur(10px);
  z-index: 100;
}

.site-title {
  color: #fff;
  background-color: var(--light-primary-color);
  border-radius: 5px;
  display: inline-block;
  will-change: transform;
  padding: 0 5px 0 5px;
  margin: 0 0 0 10px;
}

.site-title:hover {
  color: #fff;
}

.header-nav {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  color: inherit;
}

.header-nav a {
  color: #fff;
}

.menu-toggle {
  display: none;
  background: transparent;
  border: none;
  padding: 6px;
  margin-right: 10px;
  cursor: pointer;
  color: inherit;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
}

.menu-toggle svg {
  width: 28px;
  height: 28px;
  fill: #ffffff;
}

.under-header-section {
  height: 70px; /* adjust based on header height + padding */
}

/* post/article */

.article {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin: 0px 0px 20px 0px;
  padding: 30px 10px 30px 10px;
  background-color: var(--dark-secondary-color);
  border-radius: 5px;
}

/* other components */

.icon {
  width: 32px;
}

.medium-icon {
  width: 22px;
}

.link-button {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: fit-content;
  background-color: var(--light-primary-color);
  color: inherit;
  border: none;
  cursor: pointer;
  border-radius: 5px;
  padding: 10px 15px;
  transform: translateY(0) scale(1); /* start on the ground */
  transition: transform 300ms cubic-bezier(.2,.8,.2,1), background-color 180ms ease;
  transform-origin: center;
}

.link-button a {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.link-button:hover {
  background-color: var(--header-bg-color);
  animation: site-shake 1s;
  color: inherit;
}

.link-button:active {
  transform: scale(0.95);
}

.posts-list {
  list-style-type: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.posts-list-item {
  display: flex;
  flex-direction: row;
  gap: 12px;
  background-color: var(--dark-secondary-color);
  margin: 0;
  padding: 10px;
  border-radius: 5px;
  overflow: hidden;
  align-items: stretch; /* let image and info expand vertically together */
  min-height: 110px;
}

.posts-list-item:hover {
  background-color: var(--light-primary-color);
}

.posts-list-item a,
.posts-list-item p,
.posts-list-item i,
.posts-list-item b {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
  color: #fff;
}

.post-image {     
  width: 200px;
  height: 150px;
  object-fit: cover;
  border-radius: 5px;
  display: block;
}

.post-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding-left: 6px;
  color: #fff;
}


/* small shake animation on hover for the site title */
@keyframes site-shake {
  0%   { transform: translateX(0); }
  15%  { transform: rotate(-10deg); }
  30%  { transform: rotate(10deg);  }
  45%  { transform: rotate(-0.40deg); }
  60%  { transform: rotate(0.40deg);  }
  80%  { transform: rotate(-0deg); }
  100% { transform: translateX(0); }
}

.site-title:hover {
  animation: site-shake 1s;
}

.info-wrapper {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding: 10px 0px 10px 10px;
  background-color: var(--dark-secondary-color);
  border-radius: 5px;
  margin: 0px 0px 0px 0px;
}

.post-title-section {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  margin: 0 0 0 0;
  padding: 10px 0px 10px 10px;
  background-color: var(--dark-secondary-color);
  border-radius: 5px;
}

.grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 10px;
  padding: 10px;
}

.grid-container img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  object-fit: cover;
}

.main-page {
  display: flex;
  flex-direction: column;
  min-height: 50dvh;
  max-width: 800px;
  margin: 10px auto;
  padding: 0 20px;
  gap: 20px;
}

/* project container */

.project-container {
  display: flex;
  flex-direction: row;
  gap: 20px;
  background-color: var(--dark-secondary-color);
  padding: 20px;
  border-radius: 5px;
  max-width: 800px;
}

.project-image {
  width: 300px;
  height: 150px;
}

.project-details {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  color: #fff;
}

/* mini project container */

.mini-project-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background-color: var(--dark-secondary-color);
  padding: 10px;
  border-radius: 5px;
}

/* hero section */

.hero-section {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 20px;
  background-size: cover;
  padding: 60px 20px 20px 20px;
  height: 550px;
}

.hero-section-text {
  color: #fff;
  font-size: 48px;
  font-weight: bold;
}

/* Individual gifs for hero sections */

#home-hero-section {
  background-image:
    var(--gradient-color),
    url("/images/triumph-of-the-amazons-claude-deruet.jpg");
}

#blog-hero-section {
  background-image:
    var(--gradient-color),
    url("/images/musical-gathering-peter-horemans.jpg");
}

#novels-hero-section {
  background-image:
    var(--gradient-color),
    url("/images/king-lear-edwin-abbey.jpg");
}

#games-hero-section {
  background-image:
    var(--gradient-color),
    url("images/trojan-women-fleet-claude-lorrain.jpg");
}

#apps-hero-section {
  background-image:
    var(--gradient-color),
    url("/images/view-over-hallingdal-johan-dahl.jpg");
}

/* misc */

/* footer */

.footer {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 30px;
  margin: 30px 0 0 0;
  padding: 30px 20px 20px 20px;
  background-color: var(--dark-primary-color);
  color: inherit;
}

/* site nav */

.footer-high-section {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

.footer-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  justify-content: space-evenly;
}

.footer-low-section {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

/* external elements */

#google_translate_element {
  padding: 5px;
  background-color: #000000dc;
  border: 1px solid #ccc;
  border-radius: 5px;
  max-width: 300px;
  text-align: center;
}

@media (max-width: 768px) {
  .main-page {
    padding: 0 10px;
  }

  .header-nav {
    /* start hidden and drop down from beneath the header */
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background-color: var(--dark-primary-color);
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 12px;
    overflow: hidden;
    max-height: 0;                /* collapsed */
    transition: max-height 300ms cubic-bezier(.2,.8,.2,1), padding 300ms ease;
    z-index: 50;
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
  }

  .menu-toggle {
    display: block;
  }

  /* when open, allow the column to expand; set a roomy max-height */
  .header-nav.open {
    max-height: 700px; /* enough for several links; adjust if needed */
    padding: 10px 12px;
  }

  /* style nav links for column layout */
  .header-nav a {
    padding: 8px 6px;
    border-radius: 4px;
  }

  .article {
    padding: 30px 10px;
  }

  .posts-list-item {
    flex-direction: column;
    min-height: auto;
  }

  .post-image {
    width: 100%;
    max-width: 100%;
    flex: 0 0 auto;
    height: 180px; /* choose a comfortable height for stacked layout */
    margin-bottom: 8px;
  }

  .post-info {
    padding-left: 0;
  }

  .project-container {
    flex-direction: column;
  }

  .project-image {
    width: 100%;
    height: auto;
    max-height: 300px;
  }

  .hero-section {
    min-height: 400px;
    height: fit-content;
  }

  .footer-high-section {
    flex-direction: column;
    gap: 10px;
    justify-content: left;
    align-items: start;
    margin: 5px 0 0 0;
  }

  .footer-low-section {
    flex-direction: column;
    gap: 5px;
    justify-content: left;
    align-items: start;
  }
}