body {
  top: 0px !important;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.container {
  width: 95%;
  margin: 0 20px;
  padding: 20px;
  padding-top: 100px;
  background-color: #fdfdfd;
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: center;
  flex: 1 0 auto;
}

.article-content {
  text-align: center;
  max-width: 1000px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 95%;
}

.article-content h1 {
  font-size: 28px;
  color: #333;
}

.article-meta-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.article-meta-row #article-date {
  margin: 0;
}

/* Views sit immediately to the right of the publish time, with a dot divider. */
.article-views {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 15px;
  color: #888;
}

.article-views::before {
  content: "•";
  margin-right: 3px;
  color: #c4c4c4;
}

.article-views[hidden] {
  display: none;
}

.article-views i {
  font-size: 13px;
  color: #a0a0a0;
}

/* ---------- Reading progress bar ---------- */
#reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 3px;
  background: linear-gradient(90deg, #ffa24f, #ff8400);
  z-index: 2000;
  transition: width 0.12s ease-out;
  will-change: width;
}

/* ---------- Hero image fade-in (no pop-in) ---------- */
#article-image {
  opacity: 0;
  transition: opacity 0.5s ease;
}

#article-image.loaded {
  opacity: 1;
}

/* ---------- Content reveal ---------- */
.fade-init {
  opacity: 0;
}

.fade-in {
  animation: articleFadeIn 0.5s ease both;
}

@keyframes articleFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Loading skeleton ---------- */
.article-skeleton {
  width: 95%;
  max-width: 1000px;
  margin: 0 auto;
  padding-top: 10px;
}

.article-skeleton .sk {
  position: relative;
  overflow: hidden;
  background: #ececec;
  border-radius: 8px;
}

.article-skeleton .sk::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
  animation: skShimmer 1.2s infinite;
}

@keyframes skShimmer {
  100% {
    transform: translateX(100%);
  }
}

.article-skeleton .sk-title {
  height: 28px;
  margin: 10px auto;
}

.article-skeleton .sk-image {
  height: 340px;
  width: 100%;
  border-radius: 12px;
  margin: 22px 0;
}

.article-skeleton .sk-line {
  height: 15px;
  margin: 14px 0;
}

.article-skeleton .w95 { width: 95%; }
.article-skeleton .w90 { width: 90%; }
.article-skeleton .w85 { width: 85%; }
.article-skeleton .w80 { width: 80%; }
.article-skeleton .w60 { width: 60%; }
.article-skeleton .w55 { width: 55%; }

/* ---------- Not-found / error message ---------- */
.article-message {
  margin: 60px auto;
  padding: 24px 28px;
  font-size: 20px;
  color: #666;
  text-align: center;
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  #reading-progress,
  #article-image,
  .fade-in,
  .article-skeleton .sk::after {
    transition: none;
    animation: none;
  }

  .fade-init {
    opacity: 1;
  }
}

.article-content img {
  /*width: 95%;*/
  height: auto;
  max-height: 400px;
  object-fit: cover;
  margin-top: 10px;
}

.article-content p {
  font-size: 18px;
  color: #555;
  margin-top: 10px;
  text-align: justify;
}

.article-content hr {
  border: none;
  height: 1px;
  background-color: #000000;
  margin: 1rem 0;
}

#article-text {
  margin-top: 20px;
}

#article-text p {
  margin: 0 !important;
}

#article-date {
  font-size: 20px;
}

.tool-menu {
  display: flex;
  gap: 15px;
  justify-content: end;
  min-height: 80px;
}

.tool-btn {
  font-size: 22px;
  color: white;
}

.tool-btn:hover {
  font-size: 24px;
  color: black;
}

.go-back-container {
  display: flex;
  width: 90%;
  justify-content: flex-start;
}

.go-back-button {
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  border: 2px solid #ccc;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.1s;
  padding: 0;
}

.go-back-button:hover {
  background: #f9f9f9;
  border-color: #999;
  transform: translateY(-1px);
}

.go-back-button:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.go-back-button svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: #555;
}

.go-back-button:focus {
  outline: 2px solid #5b9dd9;
  outline-offset: 2px;
}

.share-buttons {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.share-buttons button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  color: white;
  font-weight: 500;
  transition: background-color 0.3s ease;
}

#share-facebook {
  background-color: #1877F2;
}

#share-twitter {
  background-color: #1DA1F2;
}

#share-telegram {
  background-color: #0088cc;
}

.share-buttons button:hover {
  opacity: 0.9;
}

.share-buttons i {
  font-size: 1.1rem;
}


/* Article Page Responsive Styles */
@media only screen and (max-width: 768px) {
  .container {
    width: 100%;
    margin: 0;
    padding: 10px;
    /*padding-top: 140px;*/
  }

  .article-content {
    padding: 0;
  }

  .article-content h1 {
    font-size: 24px;
  }

  .article-content img {
    width: 100%;
    max-height: 300px;
  }

  .article-content p {
    font-size: 16px;
  }

  #article-text img {
    width: 100%;
    border-radius: 10px;
    margin: 12px auto;
  }
}


/* Hide the Google Translate banner and other widget elements */
.goog-te-banner-frame.skiptranslate,
.goog-te-gadget-icon,
.goog-te-menu-frame,
.goog-te-menu-frame * {
  display: none !important;
}

.skiptranslate,
.skiptranslate iframe {
  display: none !important;
}

/* ---------- Inline (Quill) images inside article text (NOT the main image) ---------- */
#article-text img {
  display: block;
  width: 90%;
  max-width: 900px;
  /* prevents huge screens from stretching too much */
  height: auto;
  margin: 16px auto;
  /* center */
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* Keep figure-like spacing when Quill wraps images with <p> */
#article-text p:has(img) {
  margin: 18px 0 !important;
  text-align: center;
}

/* If browser doesn't support :has(), at least avoid squishing text around images */
#article-text img+* {
  margin-top: 14px;
}
