/* mobile */
@media (max-width: 768px) {

  .container {
    flex-direction: column;
  }

  #sidebar {
    display: none;
  }

  .nav-icons {
    display: none;
  }

}

@media (max-width: 1000px) {
  body {
    max-width: 100vw !important;
  }
}


html {
  scroll-behavior: smooth;
}

header,
aside,
main {
  background: var(--container-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0px 20px 20px 20px;
  margin: 20px 20px 0px 20px;

}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1rem 1rem 1rem;
  gap: 2rem;
  flex-wrap: wrap;

  position: sticky;
  top: 20px;
  z-index: 100;
}

header h1 {
  margin: 0;
  flex-shrink: 0;
}

header a {
  color: var(--link-color);
}

body {
  font-family: 'Geist';
  /* font-family: 'Geist', monospace; */
  margin: 0;
  transition: background 0.2s ease-in-out, color 0.2s ease-in-out;
  background: var(--page-bg-color);
  color: var(--text-color);


  max-width: 78vw;
  margin: 0 auto;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 32px;
  background: var(--page-bg-color);
  z-index: 99;
}

body.dark .nav-icons a::after {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}


aside {
  margin: 20px 0px 20px 20px;
}

main {
  margin: 20px;
  flex: 1;
}


button {
  font-size: 0.75rem;
  cursor: pointer;

  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--border-color);

  background: var(--container-color);
  color: var(--text-color);

  transition:
    opacity 0.15s ease,
    background 0.15s ease,
    border-color 0.15s ease,
    transform 0.05s ease;
}

button:hover {
  opacity: 0.6;
}

/* Markdown horizontal line: " --- " */
hr {
  border: none;
  height: 1px;
  background-color: var(--border-color);
  margin: 2rem 0;
}


h1,
h2,
h3 {
  font-family: "Domine", serif;
  scroll-margin-top: 170px;
}

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

a:hover {
  opacity: 0.8;
  color: var(--link-hover-color);
  text-decoration: underline;
}


/* Container Layout */
.container {
  display: flex;
}

/* Navigation */
.nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

.nav-left a {
  margin-right: 20px;
}


#themeSelect {
  background: var(--container-bg-color);
  color: var(--text-color);
  border: 1px solid var(--border-color);
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
}



/* Item Cards */
.item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.item-card {
  display: block;
  position: relative;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 20px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s, box-shadow 0.2s;
}

.item-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 6px;
}

.item-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  color: var(--text-color);
  text-decoration: none !important;
}

.item-date {
  font-size: 12px;
  opacity: 0.5;
}

.item-card-redirect-button {
  position: absolute;
  bottom: 20px;
  right: 20px;

  width: 44px;
  height: 44px;

  display: flex;
  align-items: center;
  justify-content: center;

  background: var(--link-color);
  color: var(--page-bg-color);

  border-radius: 50%;
  cursor: pointer;
  z-index: 2;

  transition: transform 0.2s ease, background 0.2s ease;
}

.item-card-redirect-button:hover {
  transform: scale(1.1);
  background: var(--link-hover-color);
}

.material-icons {
  font-family: 'Material Icons';
}

.tag {
  display: inline-block;
  color: var(--link-color);
  opacity: 1;
  font-size: 12px;
  padding: 3px 6px;
  border: 1px solid var(--border-color);
  margin-right: 5px;
  border-radius: 4px;
}

.content-buttons .material-icons {
  font-size: inherit !important;
  width: auto;
  height: auto;
  display: inline-block;
  vertical-align: middle;
}


/* single image */
.img-preview img {
  max-height: 300px;
  max-width: 100%;
  height: auto;
  display: block;
  transition: filter 0.2s ease, transform 0.2s ease;
  cursor: zoom-in;
}

.img-preview:hover img {
  filter: brightness(0.8);
  transform: scale(1.02);
}

/* image collection */
.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin: 20px 0px 40px 0px;

}

.image-item {
  display: block;
  overflow: hidden;
  border-radius: 10px;
  position: relative;
}

.image-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: filter 0.2s ease, transform 0.2s ease;
  cursor: zoom-in;
}

.image-item:hover img {
  filter: brightness(0.8);
  transform: scale(1.02);
}


footer {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0px 20px 10px 20px;
}


.icons {
  color: var(--border-color);
  display: flex;
  gap: 16px;
  align-items: center;
}

.icons svg {
  height: 1.5rem;
}

.icons a {
  color: var(--text-color);
  opacity: 0.85;
  transition: opacity 0.2s;
}

.icons a:hover {
  opacity: 1;
  transform: scale(1.1);
}


.build-time {
  color: var(--border-color);
  margin-bottom: 20px;
  font-size: 0.6rem;
  text-align: center;
}