/* Custom site-wide styles — append here instead of modifying styles.css */

/* Scrollbar — warm Devoid theme */
html {
  scrollbar-width: thin;
  scrollbar-color: #d4cdc4 #f7f4f0;
}
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #f7f4f0;
}
::-webkit-scrollbar-thumb {
  background: #d4cdc4;
  border-radius: 4px;
  border: 2px solid #f7f4f0;
}
::-webkit-scrollbar-thumb:hover {
  background: #9a8f82;
}

/* ============================================================
   Writings page (writings.html → /writings route)
   ============================================================ */

.blog-c-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 10%;
  width: 1px;
  background: #eae5de;
}

.blog-d-line {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 10%;
  width: 1px;
  background: #eae5de;
}

.blog-content-zone {
  margin-left: 10%;
  margin-right: 10%;
  padding: 80px 40px 60px;
}

.blog-card {
  display: grid;
  grid-template-columns: 58% 32%;
  grid-template-rows: auto auto auto 1fr;
  grid-template-areas: "date image" "topic image" "desc image" "btn image";
  column-gap: 10%;
  padding: 40px 0;
  border-top: 1px solid #eae5de;
}

.blog-card-date {
  grid-area: date;
  font-size: 12px;
  color: #9a8f82;
  margin-bottom: 12px;
  font-weight: 450;
  letter-spacing: -0.2px;
}

.blog-card-topic {
  grid-area: topic;
  font-size: 24px;
  line-height: 1.1;
  letter-spacing: -1px;
  margin-bottom: 14px;
}

.blog-card-desc {
  grid-area: desc;
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 20px;
}

.blog-card-btn {
  grid-area: btn;
  align-self: start;
  justify-self: start;
}

.blog-card-image {
  grid-area: image;
  align-self: start;
}

.blog-card-image img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 4px;
}

@media (max-width: 1023px) {
  .blog-c-line,
  .blog-d-line {
    display: none;
  }

  .blog-content-zone {
    margin-left: 0;
    margin-right: 0;
    padding: 40px 20px 40px;
  }

  .blog-page-heading {
    font-size: 2rem;
  }

  .blog-card {
    display: flex;
    flex-direction: column;
    padding: 32px 0;
  }

  .blog-card-date {
    order: 1;
    margin-bottom: 8px;
  }

  .blog-card-topic {
    order: 2;
    margin-bottom: 14px;
    font-size: 20px;
  }

  .blog-card-image {
    order: 3;
    margin: 16px 0;
  }

  .blog-card-image img {
    height: 200px;
  }

  .blog-card-desc {
    order: 4;
    margin-top: 0;
    margin-bottom: 16px;
  }

  .blog-card-btn {
    order: 5;
    width: 100%;
    justify-content: center;
    padding: 10px 16px;
  }
}

/* ============================================================
   Writing item page (writing-item.html → /writing/:id route)
   ============================================================ */

.post-c-line { position: absolute; top: 0; bottom: 0; left: 20%; width: 1px; background: #eae5de; z-index: 0; }
.post-d-line { position: absolute; top: 0; bottom: 0; right: 20%; width: 1px; background: #eae5de; z-index: 0; }

.post-content-zone { margin-left: 20%; margin-right: 20%; padding: 0 40px; }

.post-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 450;
  color: #9a8f82;
  text-decoration: none;
  transition: opacity 0.2s;
}
.post-back:hover { opacity: 0.7; }

.post-date { font-size: 12px; color: #9a8f82; font-weight: 450; letter-spacing: -0.2px; }
.post-topic { font-size: 44px; line-height: 1.05; letter-spacing: -2px; }

.post-image-full {
  margin-left: 10%;
  margin-right: 10%;
  position: relative;
  z-index: 1;
}
.post-image-full img {
  width: 100%;
  height: 440px;
  object-fit: cover;
  border-radius: 4px;
  display: block;
}

.post-body { font-size: 16px; line-height: 1.85; color: #4a4035; }
.post-body p { margin-bottom: 22px; }
.post-body h3 {
  font-family: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
  font-weight: 300;
  font-size: 24px;
  letter-spacing: -0.6px;
  line-height: 1.2;
  color: #1a1512;
  margin-top: 48px;
  margin-bottom: 16px;
}
.post-body strong { font-weight: 600; color: #1a1512; }
.post-body blockquote {
  border-left: 2px solid #eae5de;
  margin: 40px 0 0;
  padding: 14px 24px;
  color: #6b5f53;
  font-style: italic;
}

.post-loading { font-size: 14px; color: #9a8f82; margin: 0 20%; padding: 60px 40px; }

@media (max-width: 1023px) {
  .post-c-line, .post-d-line { display: none; }
  .post-content-zone { margin-left: 0; margin-right: 0; padding: 0 20px; }
  .post-topic { font-size: 26px; letter-spacing: -1px; }
  .post-image-full { margin-left: 0; margin-right: 0; }
  .post-image-full img { height: 220px; border-radius: 0; }
  .post-body { font-size: 15px; }
}

/* ============================================================
   Page loader
   ============================================================ */

#page-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #F7F4F0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}
#page-loader.hidden {
  opacity: 0;
  visibility: hidden;
}
#loader-logo {
  height: 36px;
  width: auto;
  filter: invert(1);
  mix-blend-mode: multiply;
  animation: loader-breathe 2s ease-in-out infinite;
}
@keyframes loader-breathe {
  0%, 100% { opacity: 0.45; transform: scale(1); }
  50%       { opacity: 0.9;  transform: scale(1.04); }
}
#loader-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: #EAE5DE;
  overflow: hidden;
}
#loader-progress-fill {
  height: 100%;
  width: 45%;
  background: linear-gradient(90deg, transparent, #9a8f82, transparent);
  animation: loader-sweep 1.8s ease-in-out infinite;
}
@keyframes loader-sweep {
  0%   { transform: translateX(-200%); }
  100% { transform: translateX(400%);  }
}

/* ============================================================
   Page transition
   ============================================================ */

@keyframes page-fade-in {
  from { opacity: 0; transform: translateY(7px); }
  to   { opacity: 1; transform: translateY(0);   }
}
#app.page-enter {
  animation: page-fade-in 0.22s ease forwards;
}

/* ============================================================
   Skeleton loaders (blog card shimmer)
   ============================================================ */

.sk-line {
  background: linear-gradient(90deg, #eae5de 25%, #f0ece6 50%, #eae5de 75%);
  background-size: 200% 100%;
  animation: sk-shimmer 1.4s ease-in-out infinite;
  border-radius: 3px;
  margin-bottom: 12px;
  height: 12px;
}
@keyframes sk-shimmer {
  0%   { background-position: 200% 0;  }
  100% { background-position: -200% 0; }
}
