/* ============================== */
/* 📄 Single Blog Post Layout     */
/* ============================== */

.single-post {
  max-width: 640px;
  margin: 2rem auto;
  padding: 2rem 1.25rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  font-size: 1.05rem;
  line-height: 1.65;
  color: #eaeaea;
  transition: all 0.3s ease;
}

body.light-mode .single-post {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(0, 0, 0, 0.05);
  color: #222;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.06);
}

/* 🧠 Title */
.post-article h1 {
  font-size: 1.7rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: #4dd8ff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

body.light-mode .post-article h1 {
  color: #007acc;
  text-shadow: none;
}

/* 🕒 Date */
.post-date {
  font-size: 0.85rem;
  font-style: italic;
  color: #aaa;
  margin-bottom: 1.25rem;
}

body.light-mode .post-date {
  color: #555;
}

/* 🖼 Featured Image */
.post-image-large {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  margin: 1.5rem 0;
  border-radius: 14px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  transition: transform 0.3s ease;
}

.post-image-large:hover {
  transform: scale(1.01);
}

/* 📝 Body Text */
.post-body {
  color: inherit;
}

.post-body p {
  margin-bottom: 1.4rem;
}

/* 🔙 Back Link */
.back-link {
  margin-top: 2.25rem;
  text-align: center;
}

.back-link a {
  display: inline-block;
  font-weight: 600;
  font-size: 0.95rem;
  color: #4dd8ff;
  text-decoration: none;
  transition: color 0.25s ease;
}

.back-link a:hover {
  color: #66e0ff;
}

body.light-mode .back-link a {
  color: #007acc;
}

body.light-mode .back-link a:hover {
  color: #005fa3;
}

/* 📦 Post Preview Image Wrapper */
.image-wrapper {
  width: 100%;
  aspect-ratio: 16 / 9; /* Enforces consistent shape */
  overflow: hidden;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #111; /* fallback in case image is missing */
}

/* 🖼 Force Image Fill + Crop */
.image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.3s ease;
}

.image-wrapper img:hover {
  transform: scale(1.03);
}

/* 🔗 Links inside post content */
.post-body a {
  color: #4dd8ff;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  transition: color 0.25s ease, text-decoration-color 0.3s ease;
}

.post-body a:hover {
  color: #66e0ff;
  text-decoration-color: #66e0ff;
}

/* 🌞 Light mode variant */
body.light-mode .post-body a {
  color: #007acc;
  text-decoration-color: #007acc;
}

body.light-mode .post-body a:hover {
  color: #005fa3;
  text-decoration-color: #005fa3;
}

/* ============================== */
/* 🔘 Buttons: Read More + Share  */
/* ============================== */

.read-more,
.share-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 8px;
  padding: 0.5rem 1rem;
  cursor: pointer;
  text-decoration: none;
  backdrop-filter: blur(6px);
  transition: all 0.25s ease;
}

.read-more {
  background: rgba(255, 255, 255, 0.08);
  color: #4dd8ff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.read-more:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #66e0ff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.share-button {
  background: rgba(255, 255, 255, 0.05);
  color: #eaeaea;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.5rem 0.75rem;
  font-size: 1rem;
}

.share-button:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

body.light-mode .read-more {
  background: rgba(0, 0, 0, 0.05);
  color: #0077cc;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

body.light-mode .read-more:hover {
  background: rgba(0, 0, 0, 0.08);
  color: #005fa3;
}

body.light-mode .share-button {
  background: rgba(0, 0, 0, 0.04);
  color: #444;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

body.light-mode .share-button:hover {
  background: rgba(0, 0, 0, 0.08);
  color: #000;
}

/* ============================== */
/* 🍞 Toast Feedback Popup        */
/* ============================== */

.toast-popup {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #222;
  color: #fff;
  padding: 0.6rem 1.25rem;
  border-radius: 12px;
  font-size: 0.9rem;
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 9999;
}

.toast-popup.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

body.light-mode .toast-popup {
  background: #fff;
  color: #000;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

/* ============================== */
/* 📤 Share Overlay / Sheet       */
/* ============================== */

.share-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  justify-content: center;
  align-items: flex-end;
  z-index: 9998;
}

.share-sheet {
  background: #fff;
  width: 100%;
  max-width: 400px;
  border-radius: 16px 16px 0 0;
  padding: 1rem;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.3);
  animation: slideUp 0.3s ease;
}

.share-sheet button {
  width: 100%;
  background: #f5f5f5;
  border: none;
  padding: 0.9rem;
  margin: 0.5rem 0;
  font-size: 1rem;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.share-sheet button:hover {
  background: #e0e0e0;
}

@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ============================== */
/* 📺 Responsive Embedded Video   */
/* ============================== */

.video-embed {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  margin: 2rem 0;
  border-radius: 12px;
  background: #000;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}

.video-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

body.light-mode .video-embed {
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

/* ============================== */
/* 📱 Mobile Adjustments          */
/* ============================== */

@media (max-width: 600px) {
  .single-post {
    padding: 1.5rem 1rem;
    font-size: 1rem;
  }

  .post-article h1 {
    font-size: 1.4rem;
  }

  .post-image-large {
    margin: 1.25rem 0;
  }
}
