:root {
  --template-color-0: #0073e6;
  --template-color-1: #f4f4f4;
}

body:has(#sidebar-wrapper) #entries {
  margin: 0 auto;
}

body:not(:has(#sidebar-wrapper)) {
  main {
    margin-top: 8rem;
  }

  footer {
    padding-top: 3rem;
  }
}

#entries {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-gap: 20px;
  max-width: 1200px;
  margin: 6rem auto;
  padding: 20px;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  overflow: auto;
}

.loading-entry {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-direction: column;
  padding: 1rem;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition:
    transform 0.3s,
    box-shadow 0.3s;
  position: relative;
  min-height: 357px;
  height: 100%;
}

.loading-entry::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 30px;
  height: 30px;
  margin: -15px 0 0 -15px;
  border: 4px solid #ddd;
  border-top-color: var(--template-color-0);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.blogPost {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-direction: column;
  padding: 1rem;
  cursor: pointer;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition:
    transform 0.3s,
    box-shadow 0.3s;
}

.blogPost:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.blogPost img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  margin-bottom: 10px;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
}

span[id^="EMBED:"] {
  display: none;
}

.blogPost p {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.blogPost-content {
  padding: 20px;
}

.blogPost h2 {
  margin-top: 0;
  font-size: 1.5em;
  color: #333;
}

.blogPost p {
  color: #666;
}

.post-meta {
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
  margin-top: auto;
  font-size: 0.9em;
  color: #999;
}

.post-meta .date {
  margin-left: auto;
  align-self: flex-end;
  font-weight: bold;
  font-style: italic;
}

@media (max-width: 768px) {
  #entries {
    grid-template-columns: repeat(2, 1fr);
  }
}

main:not(:has(#entries)) {
  margin: 0 auto;
  max-width: 800px;
  line-height: 1.6;
  padding: 0 20px 0 20px;
  border-radius: 8px;
  font-family: "Inter", sans-serif;

  * {
    text-align: left;
  }

  h1 {
    font-size: 2.5rem;
    margin-top: 40px;
    margin-bottom: 25px;
    line-height: 1.2;
  }

  h2 {
    font-size: 1.75rem;
    margin-top: 40px;
    margin-bottom: 25px;
    line-height: 1.3;
  }

  h3 {
    font-size: 1.5rem;
    margin-top: 35px;
    margin-bottom: 25px;
    line-height: 1.4;
  }

  h4 {
    font-size: 1.25rem;
    margin-top: 30px;
    margin-bottom: 25px;
    line-height: 1.4;
  }

  h5 {
    font-size: 1.125rem;
    margin-top: 25px;
    margin-bottom: 25px;
    line-height: 1.5;
  }

  h6 {
    font-size: 1.125rem;
    margin-bottom: 25px;
    line-height: 1.5;
  }

  p:not([data-img="true"]) {
    font-size: 18px;
    margin-bottom: 1em;
    line-height: 1.8;
  }

  p[data-img="true"] {
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 100%;
    margin: 2em auto;
    overflow: hidden;
  }

  p[data-img="true"] img {
    height: auto;
    max-width: 100%;
    margin: 0 0 10px 0;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
  }

  p[data-img="true"]:has(img:nth-child(n + 2)) img {
    max-width: calc(50% - 20px);
  }

  [data-type="image-grid"] {
    display: grid;
    gap: 10px;
    max-width: 100%;
    overflow: hidden;
  }

  [data-type="image-grid"] img {
    width: 100%;
    border-radius: 8px;
    height: auto;
    box-sizing: border-box;
    object-fit: cover;
    transform-origin: center;
    transition: transform 0.3s ease;
    aspect-ratio: 1 / 1;
  }

  ul {
    list-style-type: disc !important;
    margin-left: 20px;
    padding: 0 10px;
    border-radius: 5px;
    margin-bottom: 1.5em;
  }

  ol {
    list-style-type: decimal !important;
    margin-left: 20px;
    padding: 0 10px;
    border-radius: 5px;
    margin-bottom: 1.5em;
  }

  li {
    margin-bottom: 10px;
  }

  blockquote {
    font-size: 1.125rem;
    color: #555;
    background-color: rgba(241, 241, 241, 0.5);
    border-left: 4px solid var(--template-color-0);
    padding: 15px 20px;
    margin: 30px 0;
    font-style: italic;
    border-radius: 0 5px 5px 0;
    position: relative;
  }

  blockquote p:not([data-img="true"]) {
    margin-top: 0;
    margin-bottom: 0;
  }

  pre {
    background-color: #f4f4f4;
    padding: 15px;
    border-radius: 5px;
    font-size: 0.9em;
    overflow-x: auto;
    margin: 1.5em 0;
    border-left: 3px solid var(--template-color-0);
  }

  a {
    color: var(--template-color-0);
    cursor: pointer;
    transition: color 0.2s ease;
  }

  a:hover {
    color: #fb7185;
  }

  code {
    background-color: #f4f4f4;
    padding: 5px;
    border-radius: 5px;
    font-size: 0.9em;
    font-family: "Consolas", "Monaco", monospace;
  }

  button {
    background-color: var(--template-color-0);
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s ease;
  }

  button:hover {
    background-color: var(--template-color-1);
  }

  table {
    border-collapse: collapse;
    margin: 0;
    overflow: hidden;
    table-layout: fixed;
    width: 100%;
    border: 0.5px solid var(--template-color-0, #0073e6);
  }

  table td,
  table th {
    border: 1px solid color-mix(in srgb, var(--template-color-0, #0073e6) 40%, transparent);
    box-sizing: border-box;
    min-width: 1em;
    padding: 0.5rem;
    position: relative;
    vertical-align: top;
  }

  table th {
    background-color: color-mix(in srgb, var(--template-color-0, #0073e6) 15%, transparent);
    font-weight: bold;
    text-align: left;
    color: color-mix(in srgb, var(--template-color-0, #0073e6) 90%, black);
  }

  table p {
    margin: 0;
  }

.faq-block-container {
  margin: 2rem 0;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  padding: 1rem;
}

.faq-block-title {
  font-size: 1.5rem;
  font-weight: bold;
  color: #333;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--template-color-0);
}

.faq-item {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  margin-bottom: 1rem;
  overflow: hidden;
}

.faq-question {
  background-color: #fff;
  padding: 1.25rem;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background-color 0.2s ease;
  user-select: none;
}

.faq-question:hover {
  background-color: #f7f7f7;
  color: var(--template-color-0);
}

.faq-question[aria-expanded="true"]::after {
  transform: rotate(180deg);
}

.faq-answer {
  padding: 1.25rem;
  font-size: 17px;
  color: #555;
  line-height: 1.6;
  transition: none;
}

.faq-question::after {
  content: "↓";
  color: var(--template-color-0);
  transition: transform 0.2s ease;
}

body:has(#sidebar-wrapper) {
  padding-left: 280px;
}

@media (max-width: 768px) {
  body:has(#sidebar-wrapper) {
    padding-left: 0;
  }

  p[data-img="true"]:has(img:nth-child(n + 2)) img {
    max-width: 100%;
  }
}
