/* ================================================================
   CONTENT-FIXES.CSS — Typography & Content Quality Enhancements
   CD RESTOP Platform | 2026-03-25
   ================================================================ */

/* ── VIETNAMESE TEXT RENDERING ── */
html {
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "kern" 1, "liga" 1;
}

/* Better line-height for Vietnamese diacritics */
body {
  line-height: 1.7;
}

p, li, dd, td, th, blockquote, label, .card-excerpt, .footer-desc, .nl-desc {
  line-height: 1.75;
  letter-spacing: 0.01em;
}

h1, h2, h3, h4, h5, h6 {
  line-height: 1.3;
  letter-spacing: -0.01em;
}

/* Ensure diacritical marks don't get clipped */
.accordion-a p,
.card-body,
.card-excerpt,
.contact-detail p,
.footer-desc,
.mission p,
.whatwedo p,
.faq-hero p,
.about-hero p,
.pricing-hero p,
.blog-hero p {
  overflow: visible;
  padding-top: 0.1em;
}

/* ── ARTICLE / BLOG READING OPTIMIZATIONS ── */
.article-content,
.blog-content,
.accordion-a p {
  font-size: 1rem;
  line-height: 1.85;
  word-spacing: 0.02em;
  hyphens: auto;
  -webkit-hyphens: auto;
}

.article-content p,
.blog-content p {
  margin-bottom: 1.2em;
}

.article-content h2,
.blog-content h2 {
  margin-top: 2em;
  margin-bottom: 0.75em;
}

.article-content h3,
.blog-content h3 {
  margin-top: 1.5em;
  margin-bottom: 0.5em;
}

/* ── IMAGE PLACEHOLDER STYLING ── */
/* Gradient background placeholders for missing images */
.img-placeholder,
img[src=""],
img:not([src]),
img[src="#"] {
  background: linear-gradient(135deg, rgba(200,151,62,0.15) 0%, rgba(15,40,71,0.8) 100%);
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid rgba(200,151,62,0.15);
  position: relative;
}

img[src=""]::after,
img:not([src])::after {
  content: "Hình ảnh sắp được cập nhật";
  position: absolute;
  color: rgba(200,151,62,0.6);
  font-size: 0.85rem;
  font-weight: 500;
  text-align: center;
}

/* Card image placeholder gradients */
.card-img-placeholder {
  background: linear-gradient(135deg, #1B3A6B 0%, #0F2847 100%);
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  position: relative;
  overflow: hidden;
}

.card-img-placeholder::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(15,40,71,0.6) 100%);
}

/* Placeholder variants */
.placeholder-gold {
  background: linear-gradient(135deg, rgba(200,151,62,0.2) 0%, rgba(15,40,71,0.9) 100%) !important;
}

.placeholder-green {
  background: linear-gradient(135deg, rgba(46,125,50,0.2) 0%, rgba(15,40,71,0.9) 100%) !important;
}

.placeholder-blue {
  background: linear-gradient(135deg, rgba(42,79,140,0.25) 0%, rgba(15,40,71,0.9) 100%) !important;
}

.placeholder-purple {
  background: linear-gradient(135deg, rgba(106,27,154,0.2) 0%, rgba(15,40,71,0.9) 100%) !important;
}

/* ── SELECTION STYLING ── */
::selection {
  background: rgba(200,151,62,0.3);
  color: #fff;
}

::-moz-selection {
  background: rgba(200,151,62,0.3);
  color: #fff;
}

/* ── FOCUS ACCESSIBILITY ── */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid rgba(200,151,62,0.6);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ── SMOOTH SCROLL BEHAVIOR ── */
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── PRINT STYLES ── */
@media print {
  body {
    background: #fff !important;
    color: #000 !important;
  }
  .nav, .navbar, .footer, .mobile-menu, .hamburger,
  .floating-shape, .particles, .orb, .toast {
    display: none !important;
  }
  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #666;
  }
}
