/* Additional tweaks on top of the Tailwind bundle copied from dist/.
   Keep this minimal — the big stylesheet is assets/css/app.css. */

html[data-theme="dark"],
html.dark {
  color-scheme: dark;
}

html:not(.light):not([data-theme="light"]) body {
  background: hsl(var(--background));
  color: hsl(var(--foreground));
}

/* Navbar scrolled state */
#mo-navbar.is-scrolled {
  background: hsl(var(--background) / 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid hsl(var(--border));
}

/* AOS uses its own transitions — ensure hidden state does not flash */
[data-aos] {
  pointer-events: auto;
}

/* Preserve .container behaviour used by Tailwind's `container` class (safelist) */
.container {
  max-width: 1400px;
}

/* Hide Google Translate default UI (mirrors index.css) */
.goog-te-banner-frame,
#goog-gt-tt,
.goog-te-balloon-frame {
  display: none !important;
}

body {
  top: 0 !important;
}

.goog-te-gadget {
  font-size: 0 !important;
}

.skiptranslate {
  display: none !important;
}

/* Basic prose styling for blog content (markdown legacy + HTML từ content engine) */
.prose-custom {
  color: hsl(var(--foreground) / 0.85);
}

.prose-custom p {
  color: hsl(var(--foreground) / 0.85);
  line-height: 1.8;
  margin: 1rem 0;
  font-size: 1.0625rem;
}

.prose-custom h1 {
  font-size: 2rem;
  font-weight: 800;
  margin: 2rem 0 1.25rem;
  color: hsl(var(--foreground));
  line-height: 1.2;
}

.prose-custom h2 {
  font-size: 1.625rem;
  font-weight: 700;
  margin: 2.75rem 0 1rem;
  color: hsl(var(--foreground));
  line-height: 1.3;
  padding-top: 0.5rem;
  border-top: 1px solid hsl(var(--border) / 0.5);
}

.prose-custom h2:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.prose-custom h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 2rem 0 0.75rem;
  color: hsl(var(--foreground));
}

.prose-custom h4 {
  font-size: 1.0625rem;
  font-weight: 700;
  margin: 1.5rem 0 0.5rem;
  color: hsl(var(--foreground));
}

.prose-custom ul,
.prose-custom ol {
  padding-left: 1.5rem;
  margin: 1rem 0;
  color: hsl(var(--foreground) / 0.85);
}

.prose-custom ul {
  list-style: disc;
}

.prose-custom ol {
  list-style: decimal;
}

.prose-custom li {
  margin: 0.4rem 0;
  line-height: 1.7;
}

.prose-custom li>ul,
.prose-custom li>ol {
  margin: 0.4rem 0;
}

.prose-custom strong {
  color: hsl(var(--foreground));
  font-weight: 600;
}

.prose-custom em {
  font-style: italic;
}

.prose-custom a {
  color: hsl(var(--primary));
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.prose-custom a:hover {
  color: hsl(var(--primary) / 0.8);
}

.prose-custom blockquote {
  border-left: 3px solid hsl(var(--primary));
  padding: 0.5rem 0 0.5rem 1rem;
  margin: 1.5rem 0;
  color: hsl(var(--muted-foreground));
  font-style: italic;
  background: hsl(var(--muted) / 0.3);
  border-radius: 0 0.375rem 0.375rem 0;
}

.prose-custom code {
  background: hsl(var(--muted) / 0.6);
  color: hsl(var(--foreground));
  padding: 0.15rem 0.4rem;
  border-radius: 0.25rem;
  font-size: 0.92em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.prose-custom pre {
  background: hsl(var(--muted) / 0.5);
  border: 1px solid hsl(var(--border));
  padding: 1rem 1.25rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  margin: 1.5rem 0;
  font-size: 0.9rem;
  line-height: 1.55;
}

.prose-custom pre code {
  background: transparent;
  padding: 0;
  border-radius: 0;
  font-size: inherit;
}

.prose-custom img {
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
  margin: 1.5rem auto;
  display: block;
  border: 1px solid hsl(var(--border));
}

.prose-custom hr {
  border: 0;
  border-top: 1px solid hsl(var(--border));
  margin: 2.5rem 0;
}

.prose-custom table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.95rem;
}

.prose-custom th,
.prose-custom td {
  border: 1px solid hsl(var(--border));
  padding: 0.6rem 0.85rem;
  text-align: left;
}

.prose-custom th {
  background: hsl(var(--muted) / 0.5);
  font-weight: 600;
  color: hsl(var(--foreground));
}

/* line-clamp utility fallback (Tailwind v3 safelist issue) */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

/* ===== Floating social widget (bottom-right) ===== */
.mo-float {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.mo-float__item {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 48px;
  width: 48px;
  padding: 0;
  border-radius: 9999px;
  background: var(--mo-float-bg, #1877F2);
  color: #fff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.06) inset;
  overflow: hidden;
  text-decoration: none;
  white-space: nowrap;
  transform: translateY(20px);
  opacity: 0;
  animation: mo-float-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: var(--mo-float-delay, 0ms);
  transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1), padding 0.35s cubic-bezier(0.22, 1, 0.36, 1), justify-content 0s, box-shadow 0.25s ease, transform 0.25s ease;
}

.mo-float__item:hover {
  width: 220px;
  padding: 0 16px;
  justify-content: flex-end;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.08) inset;
  transform: translateY(-2px);
}

.mo-float__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.mo-float__label {
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  transform: translateX(8px);
  transition: opacity 0.25s ease 0.05s, transform 0.25s ease 0.05s;
}

.mo-float__item:hover .mo-float__label {
  opacity: 1;
  transform: translateX(0);
}

/* Gentle pulse ring on the first item to draw attention */
.mo-float__item:first-child::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: 0 0 0 0 var(--mo-float-bg, #1877F2);
  animation: mo-float-pulse 2.4s ease-out infinite;
  pointer-events: none;
}

.mo-float__item {
  position: relative;
}

@keyframes mo-float-in {
  from {
    transform: translateY(20px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes mo-float-pulse {
  0% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--mo-float-bg) 55%, transparent);
  }

  80% {
    box-shadow: 0 0 0 14px color-mix(in srgb, var(--mo-float-bg) 0%, transparent);
  }

  100% {
    box-shadow: 0 0 0 0 transparent;
  }
}

@media (max-width: 640px) {
  .mo-float {
    right: 0.75rem;
    bottom: 0.75rem;
    gap: 8px;
  }

  .mo-float__item {
    height: 44px;
    width: 44px;
  }

  .mo-float__item:hover {
    width: 190px;
  }
}

@media (prefers-reduced-motion: reduce) {

  .mo-float__item,
  .mo-float__item:first-child::before {
    animation: none;
  }

  .mo-float__item {
    transform: none;
    opacity: 1;
  }
}