/* =========================================================================
   KMS KAIZEN MANAGEMENT SYSTEM - CONTINUOUS IMPROVEMENT INSIGHTS & BLOG STYLES
   ========================================================================= */

/* --- Reading Progress Bar --- */
.reading-progress-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: transparent;
  z-index: 10005;
}
.reading-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--kaizen-red) 0%, #ff8b7a 100%);
  width: 0%;
  transition: width 0.1s ease-out;
  box-shadow: 0 0 10px rgba(225, 59, 59, 0.5);
}

/* --- Full Screen Article Loader --- */
.blog-loader-overlay {
  position: fixed;
  inset: 0;
  background: var(--ink);
  z-index: 10010;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease;
}
.blog-loader-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  color: #FFFFFF;
  font-family: var(--font-display);
}
.spinner-ring {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--kaizen-red);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.spinner-brand {
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  color: #b7c2d6;
}

/* --- Breadcrumb Bar & Header Fixes --- */
.nav {
  background: rgba(246, 247, 249, 0.95);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-bottom-color: var(--line);
  box-shadow: var(--shadow-sm);
}
.nav:not(.is-scrolled) .nav__links a {
  color: var(--steel);
}
.nav:not(.is-scrolled) .nav__links a.is-active,
.nav:not(.is-scrolled) .nav__links a:hover {
  color: var(--kaizen-red);
}
.nav:not(.is-scrolled) .nav__links a::after {
  background: var(--kaizen-red);
}
.nav:not(.is-scrolled) .brand__text {
  color: var(--ink);
}
.nav:not(.is-scrolled) .brand__text em {
  color: var(--steel-light);
}
.nav:not(.is-scrolled) .nav__burger span {
  background: var(--ink);
}

.breadcrumb-bar {
  background: var(--paper-2);
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
  font-size: 0.86rem;
  margin-top: 76px;
}
.breadcrumb-bar ol {
  display: flex;
  align-items: center;
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}
.breadcrumb-bar li {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--steel-light);
}
.breadcrumb-bar li:not(:last-child)::after {
  content: "/";
  color: var(--line);
  font-weight: 600;
}
.breadcrumb-bar a {
  color: var(--steel);
  text-decoration: none;
  transition: color 0.2s ease;
}
.breadcrumb-bar a:hover {
  color: var(--kaizen-red);
}
.breadcrumb-bar li[aria-current="page"] {
  color: var(--ink);
  font-weight: 600;
  max-width: 100%;
  white-space: normal;
  word-break: break-word;
}

/* --- Homepage Insights Grid Section --- */
.all-blogs-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 30px;
}
@media (min-width: 768px) {
  .all-blogs-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 1100px) {
  .all-blogs-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.blog-card {
  background: #FFFFFF;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s var(--ease);
}
.blog-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px -15px rgba(11, 30, 51, 0.16);
  border-color: rgba(225, 59, 59, 0.4);
}

.card-img-wrap {
  position: relative;
  height: 220px;
  overflow: hidden;
  background: var(--ink);
}
.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}
.blog-card:hover .card-img {
  transform: scale(1.06);
}
.card-category-badge {
  position: absolute;
  bottom: 14px;
  left: 14px;
  background: var(--ink);
  color: #FFFFFF;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 5px 12px;
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.card-body {
  padding: 26px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.blog-meta-top {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--steel-light);
  margin-bottom: 12px;
}
.card-title {
  font-family: var(--font-display);
  font-size: 1.18rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--ink);
  margin: 0 0 12px 0;
}
.card-title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}
.card-title a:hover {
  color: var(--kaizen-red);
}
.card-excerpt {
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--steel);
  margin: 0 0 20px 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-tags-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.mini-tag {
  font-size: 0.74rem;
  color: var(--steel);
  background: var(--paper-2);
  padding: 3px 9px;
  border-radius: 6px;
  font-weight: 500;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.read-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s ease;
}
.read-more-btn svg {
  transition: transform 0.2s ease;
}
.blog-card:hover .read-more-btn {
  color: var(--kaizen-red);
}
.blog-card:hover .read-more-btn svg {
  transform: translateX(4px);
}

/* --- ARTICLE DETAIL STYLES --- */
.article-header {
  padding: 56px 0 36px 0;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}
.category-tag {
  display: inline-block;
  background: rgba(225, 59, 59, 0.08);
  color: var(--kaizen-red);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 16px;
}
.article-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 3.8vw, 2.9rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--ink);
  margin: 0 0 24px 0;
}
.article-meta-large {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.author-info {
  display: flex;
  align-items: center;
  gap: 12px;
}
.author-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--ink);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.9rem;
}
.author-details {
  display: flex;
  flex-direction: column;
}
.author-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink);
}
.author-role {
  font-size: 0.78rem;
  color: var(--steel-light);
}
.meta-divider {
  width: 1px;
  height: 28px;
  background: var(--line);
}
.article-time-info {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.86rem;
  color: var(--steel);
}
.article-time-info span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.article-hero-media {
  margin: 40px auto 48px auto;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  max-height: 480px;
}
.article-hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Article Typography */
.article-body {
  font-size: 1.08rem;
  line-height: 1.78;
  color: #1F2937;
}
.article-body p {
  margin-bottom: 24px;
}
.article-body .lead-text {
  font-size: 1.25rem;
  line-height: 1.7;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 28px;
}
.article-body h2 {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--ink);
  margin: 48px 0 20px 0;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--paper-2);
}
.article-body h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--ink-3);
  margin: 32px 0 14px 0;
}

.article-callout {
  background: #F0F4F8;
  border-left: 4px solid var(--ink);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 22px 26px;
  margin: 36px 0;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.article-callout .callout-icon {
  width: 28px;
  height: 28px;
  color: var(--kaizen-red);
  flex-shrink: 0;
  margin-top: 2px;
}
.article-callout h4 {
  margin: 0 0 4px 0;
  font-size: 1.05rem;
  color: var(--ink);
}
.article-callout p {
  margin: 0;
  font-size: 0.96rem;
  color: var(--steel);
}

.article-pullquote {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.48;
  color: var(--ink);
  background: rgba(225, 59, 59, 0.06);
  border-left: 5px solid var(--kaizen-red);
  padding: 24px 28px;
  margin: 40px 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
}

.styled-list, .styled-steps {
  margin: 20px 0 28px 0;
  padding-left: 22px;
}
.styled-list li, .styled-steps li {
  margin-bottom: 12px;
  line-height: 1.65;
  color: var(--steel);
}

.article-cta-box {
  background: linear-gradient(135deg, var(--ink) 0%, var(--ink-3) 100%);
  color: #FFFFFF;
  padding: 44px 36px;
  border-radius: var(--radius-lg);
  margin: 52px 0;
  text-align: center;
  box-shadow: var(--shadow-md);
}
.article-cta-box h3 {
  color: #FFFFFF;
  margin: 0 0 12px 0;
  font-size: 1.55rem;
}
.article-cta-box p {
  color: #b7c2d6;
  margin: 0 0 26px 0;
  font-size: 1rem;
}

.article-tags-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 24px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin: 44px 0;
}
.tags-label {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--ink);
}
.article-tag-chip {
  background: var(--paper-2);
  color: var(--steel);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
}

/* Post Navigation (Prev / Next) */
.post-navigation-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 20px;
  margin-bottom: 56px;
}
@media (min-width: 640px) {
  .post-navigation-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
.nav-card {
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 22px 24px;
  text-decoration: none;
  color: var(--ink);
  transition: all 0.25s var(--ease);
  display: flex;
  flex-direction: column;
}
.nav-card:hover {
  border-color: var(--kaizen-red);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}
.nav-card-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--steel-light);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav-card-title {
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--ink);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.nav-card.next {
  text-align: right;
}
.nav-card.next .nav-card-label {
  justify-content: flex-end;
}

/* Related Posts Section */
.related-posts-section {
  background: var(--paper-2);
  padding: 64px 0;
  border-top: 1px solid var(--line);
}

/* FOOTER READABILITY & HIGH-CONTRAST OVERRIDES */
.footer {
  background: #081524 !important;
  color: #CBD5E1 !important;
}
.footer__brand p {
  color: #CBD5E1 !important;
  font-size: 0.92rem !important;
}
.footer__col h3 {
  color: #FFFFFF !important;
  font-size: 0.92rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.05em !important;
  text-transform: uppercase !important;
  margin-bottom: 10px !important;
}
.footer__col a {
  color: #E2E8F0 !important;
  font-size: 0.93rem !important;
  font-weight: 500 !important;
  text-decoration: none !important;
  transition: color 0.2s ease !important;
}
.footer__col a:hover {
  color: var(--kaizen-red) !important;
  text-decoration: underline !important;
}
.footer__col .muted {
  color: #94A3B8 !important;
  font-size: 0.88rem !important;
}
.footer__bottom {
  color: #CBD5E1 !important;
  font-size: 0.88rem !important;
  border-top: 1px solid rgba(255, 255, 255, 0.12) !important;
}
.footer-link, .footer__bottom a {
  color: #FFFFFF !important;
  font-weight: 600 !important;
}
.footer-link:hover, .footer__bottom a:hover {
  color: var(--kaizen-red) !important;
}
