/* =====================================================
   BLOG DETAIL PAGE – Matches Project Detail (port_details)
   Same layout: white card, 2-col grid, sidebar, images,
   colors: #3366ff blue, #00cc99 green, #1f2937 dark,
   #4b5563 body text, Poppins + Playfair Display
   ===================================================== */

/* Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  background: #f9f4ec;
}

/* ---------- PROGRESS SIDEBAR ---------- */
.kblog-progress-sidebar {
  position: fixed;
  left: 0.75rem;
  top: 6rem;
  bottom: 4rem;
  width: 4px;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 999px;
  z-index: 50;
}

.kblog-progress-bar {
  width: 100%;
  height: 0;
  background: #3366ff;
  border-radius: 999px;
  transition: height 0.1s linear;
}

/* ---------- MAIN CONTAINER (matches kfd-container) ---------- */
main.kbd-container {
  max-width: 1200px;
  width: 90%;
  margin: 4rem auto 5rem;
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 3rem;
  background: #fff;
  border-radius: 20px;
  padding: 4rem 3rem 5rem;
  box-shadow: 0 18px 60px rgba(51, 102, 255, 0.15);
  position: relative;
  transition: box-shadow 0.3s ease;
}

main.kbd-container:hover {
  box-shadow: 0 22px 70px rgba(51, 102, 255, 0.25);
}

/* ---------- BACK BUTTON ---------- */
.kbd-back-button {
  position: absolute;
  top: 24px;
  left: 32px;
  background-color: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  user-select: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  transition:
    transform 0.3s ease,
    color 0.3s ease;
  color: #3366ff;
  outline-offset: 3px;
  z-index: 10;
}

.kbd-back-button svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  user-select: none;
}

.kbd-back-button:hover,
.kbd-back-button:focus {
  color: #0051cc;
  outline: 2px solid #0051cc;
  outline-offset: 3px;
  animation: kbd-bounce-left 0.3s ease forwards;
}

@keyframes kbd-bounce-left {
  0% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(-8px);
  }
  100% {
    transform: translateX(-4px);
  }
}

/* ---------- ANIMATIONS ---------- */
.kbd-anim {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.6s ease,
    transform 0.6s ease;
}

.kbd-anim.kbd-visible {
  opacity: 1 !important;
  transform: translateY(0) !important;
}

/* ---------- LEFT CONTENT AREA ---------- */
.kbd-main-content {
  display: flex;
  flex-direction: column;
  gap: 3.5rem;
}

/* Category Label (matches kfd-project-category) */
.kbd-blog-category {
  color: #00cc99;
  font-weight: 700;
  letter-spacing: 0.15em;
  font-size: 1.2rem;
  border-bottom: 3px solid #00cc99;
  padding-bottom: 6px;
  display: inline-block;
  user-select: none;
  text-transform: uppercase;
  font-family: "Poppins", sans-serif;
  transition: color 0.3s ease;
}

.kbd-blog-category:hover,
.kbd-blog-category:focus {
  color: #008066;
  border-color: #008066;
  outline: none;
}

/* Title (matches kfd-project-title) */
.kbd-blog-title {
  font-family: "Playfair Display", serif;
  font-weight: 900;
  font-size: 4rem;
  line-height: 1.1;
  color: #1f2937;
  user-select: none;
  margin-top: 0.4rem;
  margin-bottom: 1.6rem;
  max-width: 720px;
  letter-spacing: 0.02em;
}

/* Intro (matches kfd-project-intro) */
.kbd-blog-intro {
  font-size: 1.25rem;
  line-height: 1.75;
  color: #4b5563;
  font-style: italic;
  border-left: 6px solid #00cc99;
  padding-left: 1.5rem;
  padding-top: 1rem;
  padding-bottom: 1rem;
  background: #e6f9f5;
  border-radius: 14px;
  box-shadow: 0 6px 20px rgba(0, 204, 153, 0.1);
  max-width: 720px;
  transition:
    box-shadow 0.3s ease,
    color 0.3s ease;
}

.kbd-blog-intro:hover,
.kbd-blog-intro:focus-within {
  box-shadow: 0 10px 30px rgba(0, 204, 153, 0.18);
  outline: none;
  color: #008066;
}

/* ---------- SECTION TITLES (matches kfd-section-title) ---------- */
.kbd-section-title {
  font-weight: 900;
  font-size: 2rem;
  color: #1f2937;
  border-left: 6px solid #3366ff;
  padding-left: 1.3rem;
  letter-spacing: 0.12em;
  margin-bottom: 1.8rem;
  user-select: none;
  font-family: "Poppins", sans-serif;
  text-transform: uppercase;
  text-shadow: 0 1px 3px rgba(51, 102, 255, 0.15);
  transition: color 0.3s ease;
}

.kbd-section-title:hover,
.kbd-section-title:focus {
  color: #3366ff;
  outline: none;
}

/* Section Text (matches kfd-section-text) */
.kbd-section-text {
  font-size: 1.18rem;
  line-height: 1.75;
  color: #4b5563;
  margin-bottom: 1.5rem;
  letter-spacing: 0.02em;
  max-width: 720px;
  transition: color 0.3s ease;
}

.kbd-section-text:hover,
.kbd-section-text:focus {
  color: #00cc99;
  outline: none;
}

/* ---------- LISTS (matches kfd-project-list) ---------- */
.kbd-blog-ol {
  margin-left: 2rem;
  font-size: 1.12rem;
  color: #4b5563;
  line-height: 1.6;
  list-style-type: decimal;
  letter-spacing: 0.02em;
  max-width: 720px;
}

.kbd-blog-ul {
  margin-left: 2rem;
  font-size: 1.12rem;
  color: #4b5563;
  line-height: 1.6;
  list-style-type: disc;
  letter-spacing: 0.02em;
  max-width: 720px;
}

.kbd-blog-list li {
  margin-bottom: 0.75rem;
  cursor: default;
  transition: color 0.25s ease;
  user-select: none;
}

.kbd-blog-list li:hover,
.kbd-blog-list li:focus {
  color: #3366ff;
  outline: none;
}

/* ---------- BLOCKQUOTE (matches kfd-project-intro style) ---------- */
.kbd-blog-quote {
  font-size: 1.25rem;
  line-height: 1.75;
  color: #4b5563;
  font-style: italic;
  border-left: 6px solid #00cc99;
  padding: 1.5rem 1.5rem;
  background: #e6f9f5;
  border-radius: 14px;
  box-shadow: 0 6px 20px rgba(0, 204, 153, 0.1);
  max-width: 720px;
  position: relative;
  margin: 0;
  transition:
    box-shadow 0.3s ease,
    color 0.3s ease;
}

.kbd-blog-quote:hover,
.kbd-blog-quote:focus-within {
  box-shadow: 0 10px 30px rgba(0, 204, 153, 0.18);
  outline: none;
  color: #008066;
}

.kbd-blog-quote::before {
  content: "\201C";
  position: absolute;
  top: 0.3rem;
  left: 1rem;
  font-size: 4rem;
  line-height: 1;
  color: #00cc99;
  font-family: "Playfair Display", serif;
  opacity: 0.4;
}

.kbd-blog-quote p {
  margin: 0;
  position: relative;
  z-index: 1;
}

/* ---------- DETAIL BLOCKS (matches kfd-project-details) ---------- */
.kbd-detail-cards {
  max-width: 720px;
  display: flex;
  gap: 2.5rem;
  flex-wrap: wrap;
}

.kbd-detail-block {
  background: #f0faf8;
  border-radius: 18px;
  padding: 2.2rem 2.6rem;
  flex: 1 1 320px;
  box-shadow: 0 8px 26px rgba(0, 204, 153, 0.14);
  cursor: default;
  transition: box-shadow 0.3s ease;
  user-select: none;
}

.kbd-detail-block:hover,
.kbd-detail-block:focus-within {
  box-shadow: 0 14px 44px rgba(0, 204, 153, 0.3);
  outline: none;
}

.kbd-detail-title {
  font-weight: 900;
  font-size: 1.45rem;
  color: #00cc99;
  margin-bottom: 1.2rem;
  border-bottom: 3px solid #00cc99;
  padding-bottom: 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-family: "Poppins", sans-serif;
}

.kbd-detail-list {
  list-style: none;
  padding-left: 0;
  margin: 0;
  color: #4b5563;
  font-size: 1.12rem;
  line-height: 1.65;
}

.kbd-detail-list li {
  margin-bottom: 0.85rem;
  padding-left: 1.6rem;
  position: relative;
  transition: color 0.3s ease;
}

.kbd-detail-list li::before {
  content: "\2022";
  position: absolute;
  left: 0;
  color: #00cc99;
  font-size: 1.6rem;
  line-height: 1;
  top: 0.2rem;
  user-select: none;
}

.kbd-detail-list li:hover,
.kbd-detail-list li:focus {
  color: #008066;
  outline: none;
}

/* ---------- RIGHT SIDEBAR (matches kfd-sidebar) ---------- */
.kbd-sidebar {
  position: sticky;
  top: 4rem;
  display: flex;
  flex-direction: column;
  gap: 1.8rem;
  max-width: 360px;
  font-weight: 700;
  color: #4b5563;
  font-size: 1.25rem;
  user-select: none;
}

/* Info Panel (matches kfd-info-bar) */
.kbd-info-bar {
  background: #e6f9f5;
  border-radius: 24px;
  padding: 2.5rem 3rem;
  box-shadow: 0 14px 40px rgba(0, 204, 153, 0.15);
  display: flex;
  flex-direction: column;
  gap: 2rem;
  transition: box-shadow 0.3s ease;
}

.kbd-info-bar:hover,
.kbd-info-bar:focus-within {
  box-shadow: 0 18px 56px rgba(0, 204, 153, 0.25);
  outline: none;
}

.kbd-info-block {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  background: #fff;
  padding: 1.5rem 2rem;
  border-radius: 18px;
  box-shadow: 0 6px 22px rgba(0, 204, 153, 0.12);
  cursor: default;
  transition:
    box-shadow 0.3s ease,
    transform 0.3s ease;
}

.kbd-info-block:hover,
.kbd-info-block:focus-within {
  box-shadow: 0 12px 48px rgba(0, 204, 153, 0.35);
  transform: translateY(-6px);
  outline: none;
}

.kbd-info-icon {
  width: 26px;
  height: 26px;
  fill: #00cc99;
  flex-shrink: 0;
}

.kbd-info-label {
  font-size: 1rem;
  color: #00cc99;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 800;
  margin-bottom: 4px;
}

.kbd-info-value {
  color: #1f2937;
  font-weight: 700;
  font-size: 1.2rem;
  line-height: 1.2;
}

.kbd-info-value a {
  color: #3366ff;
  border-bottom: 2px solid transparent;
  padding-bottom: 3px;
  transition: border-color 0.3s ease;
}

.kbd-info-value a:hover,
.kbd-info-value a:focus {
  border-color: #3366ff;
  outline: none;
}

/* Metrics (matches kfd-metrics-section) */
.kbd-metrics-section {
  background: #eaf6ff;
  border-radius: 24px;
  padding: 2.8rem 3rem;
  box-shadow: 0 14px 44px rgba(51, 102, 255, 0.2);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
  gap: 2rem;
  font-weight: 900;
  font-family: "Poppins", sans-serif;
  color: #3366ff;
  text-align: center;
  user-select: none;
}

.kbd-metric {
  flex: 1 1 140px;
  font-size: 3.2rem;
  letter-spacing: 0.07em;
  line-height: 1;
  cursor: default;
  transition: color 0.3s ease;
  user-select: none;
}

.kbd-metric:hover,
.kbd-metric:focus {
  color: #0051cc;
  outline: none;
}

.kbd-metric-label {
  font-size: 1.15rem;
  color: #0051cc;
  margin-top: 0.45rem;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.15em;
  user-select: none;
}

/* ---------- SHARE BAR IN SIDEBAR ---------- */
.kbd-share-bar {
  background: #f0faf8;
  border-radius: 24px;
  padding: 2rem 2.5rem;
  box-shadow: 0 8px 26px rgba(0, 204, 153, 0.14);
  text-align: center;
  transition: box-shadow 0.3s ease;
}

.kbd-share-bar:hover,
.kbd-share-bar:focus-within {
  box-shadow: 0 14px 44px rgba(0, 204, 153, 0.3);
  outline: none;
}

.kbd-share-title {
  font-weight: 900;
  font-size: 1.2rem;
  color: #00cc99;
  margin-bottom: 1.2rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-family: "Poppins", sans-serif;
}

.kbd-share-icons {
  display: flex;
  justify-content: center;
  gap: 0.8rem;
}

.kbd-share-icon {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: #1f2937;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition:
    background 0.25s,
    transform 0.2s,
    box-shadow 0.25s;
}

.kbd-share-icon:hover {
  background: #3366ff;
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(51, 102, 255, 0.3);
}

.kbd-share-icon svg {
  stroke: #fff;
}

/* ---------- IMAGES ROW (matches kfd-images-row) ---------- */
.kbd-images-row {
  max-width: 1200px;
  margin-top: 5rem;
  display: flex;
  gap: 2.5rem;
  flex-wrap: wrap;
  align-items: stretch;
}

.kbd-image-large,
.kbd-image-small {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  cursor: zoom-in;
  box-shadow: 0 16px 52px rgba(0, 204, 153, 0.32);
  transition:
    transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.4s ease;
  will-change: transform;
  border: 2px solid transparent;
  display: flex;
  flex-direction: column;
  justify-content: stretch;
}

.kbd-image-large:hover,
.kbd-image-large:focus-within,
.kbd-image-small:hover,
.kbd-image-small:focus-within {
  transform: scale(1.07);
  box-shadow: 0 26px 68px rgba(0, 204, 153, 0.45);
  outline: none;
  border-color: #00cc99;
}

/* Overlay effect */
.kbd-image-large::after,
.kbd-image-small::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(0, 204, 153, 0.15) 0%,
    rgba(0, 204, 153, 0) 60%
  );
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
  border-radius: inherit;
}

.kbd-image-large:hover::after,
.kbd-image-large:focus-within::after,
.kbd-image-small:hover::after,
.kbd-image-small:focus-within::after {
  opacity: 1;
}

/* Image styling */
.kbd-image-large img,
.kbd-image-small img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  aspect-ratio: 4 / 3;
  border-radius: inherit;
  filter: drop-shadow(0 5px 14px rgba(0, 204, 153, 0.2));
  transition: filter 0.3s ease;
  user-select: none;
}

.kbd-image-large img:hover,
.kbd-image-small img:hover {
  filter: drop-shadow(0 10px 22px rgba(0, 204, 153, 0.38));
}

/* Small column adjustments */
.kbd-image-small-column {
  flex: 1 1 30%;
  display: flex;
  flex-direction: column;
  gap: 3rem;
  justify-content: stretch;
}

/* Large image flex */
.kbd-image-large {
  flex: 2 1 65%;
}

/* ---------- BOTTOM SECTION (Author Bio + Comment) ---------- */
.kbd-bottom-section {
  margin-top: 4rem;
}

/* Author Bio Card (matches kfd-detail-block style) */
.kbd-author-bio-card {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  margin-bottom: 3rem;
  padding: 2.5rem 2.5rem;
  background: #f0faf8;
  border-radius: 18px;
  box-shadow: 0 8px 26px rgba(0, 204, 153, 0.14);
  border: 1px solid rgba(0, 204, 153, 0.12);
  transition: box-shadow 0.3s ease;
}

.kbd-author-bio-card:hover,
.kbd-author-bio-card:focus-within {
  box-shadow: 0 14px 44px rgba(0, 204, 153, 0.3);
  outline: none;
}

.kbd-bio-avatar {
  width: 72px;
  height: 72px;
  border-radius: 999px;
  object-fit: cover;
  flex-shrink: 0;
  border: 3px solid #fff;
  box-shadow: 0 6px 18px rgba(0, 204, 153, 0.2);
}

.kbd-bio-body {
  flex: 1;
}

.kbd-bio-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.kbd-bio-name {
  font-size: 1.15rem;
  font-weight: 900;
  color: #1f2937;
  margin: 0;
  font-family: "Poppins", sans-serif;
}

.kbd-bio-role {
  font-size: 0.85rem;
  color: #00cc99;
  margin: 0;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.kbd-bio-socials {
  display: flex;
  gap: 0.6rem;
}

.kbd-bio-socials a {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #1f2937;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition:
    background 0.25s,
    transform 0.2s,
    box-shadow 0.25s;
}

.kbd-bio-socials a:hover {
  background: #3366ff;
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(51, 102, 255, 0.3);
}

.kbd-bio-socials a svg {
  stroke: #fff;
}

.kbd-bio-desc {
  font-size: 1rem;
  line-height: 1.7;
  color: #4b5563;
  margin: 0;
  letter-spacing: 0.02em;
}

/* ---------- COMMENT SECTION ---------- */
.kbd-comment-section {
  margin: 0;
}

.kbd-comment-title {
  font-weight: 900;
  font-size: 2rem;
  color: #1f2937;
  border-left: 6px solid #3366ff;
  padding-left: 1.3rem;
  letter-spacing: 0.12em;
  margin-bottom: 1.8rem;
  user-select: none;
  font-family: "Poppins", sans-serif;
  text-transform: uppercase;
  text-shadow: 0 1px 3px rgba(51, 102, 255, 0.15);
}

.kbd-comment-form {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.kbd-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
}

.kbd-comment-form input,
.kbd-comment-form textarea {
  width: 100%;
  padding: 1rem 1.4rem;
  border: 2px solid rgba(0, 204, 153, 0.2);
  border-radius: 14px;
  background: #f0faf8;
  font-family: "Poppins", sans-serif;
  font-size: 1rem;
  color: #1f2937;
  transition:
    border-color 0.25s,
    box-shadow 0.25s,
    background 0.25s;
  outline: none;
}

.kbd-comment-form input:focus,
.kbd-comment-form textarea:focus {
  border-color: #3366ff;
  box-shadow: 0 0 0 4px rgba(51, 102, 255, 0.12);
  background: #fff;
}

.kbd-comment-form textarea {
  resize: vertical;
  min-height: 140px;
}

.kbd-submit-btn {
  align-self: flex-start;
  padding: 1rem 2.6rem;
  background: #3366ff;
  color: #fff;
  border: none;
  border-radius: 999px;
  font-family: "Poppins", sans-serif;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.05em;
  transition:
    background 0.25s,
    transform 0.2s,
    box-shadow 0.25s;
}

.kbd-submit-btn:hover {
  background: #0051cc;
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(51, 102, 255, 0.3);
}

/* ---------- LIGHTBOX (matches kfd-lightbox) ---------- */
.kbd-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(31, 41, 55, 0.9);
  display: none;
  justify-content: center;
  align-items: center;
  cursor: zoom-out;
  z-index: 9999;
  padding: 1rem;
}

.kbd-lightbox.active {
  display: flex;
}

.kbd-lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 24px;
  box-shadow: 0 12px 40px rgba(0, 204, 153, 0.6);
  user-select: none;
  pointer-events: none;
  transition: transform 0.3s ease;
}

/* ---------- CTA BAND ---------- */
.kbd-cta-band {
  margin: 0;
  padding: 5rem 2rem;
  background:
    radial-gradient(
      circle at 20% 50%,
      rgba(118, 159, 255, 0.25),
      transparent 55%
    ),
    radial-gradient(circle at 80% 50%, rgba(0, 204, 153, 0.2), transparent 55%),
    #1f2937;
  text-align: center;
}

.kbd-cta-inner {
  max-width: 640px;
  margin: 0 auto;
}

.kbd-cta-kicker {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 0.8rem;
}

.kbd-cta-heading {
  font-family: "Playfair Display", serif;
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  line-height: 1.2;
  color: #fff;
  margin-bottom: 2rem;
}

.kbd-cta-btn {
  display: inline-block;
  padding: 0.85rem 2.4rem;
  background: #fff;
  color: #1f2937;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  transition:
    background 0.25s,
    transform 0.2s,
    box-shadow 0.25s,
    color 0.25s;
}

.kbd-cta-btn:hover {
  background: #3366ff;
  color: #fff;
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(51, 102, 255, 0.3);
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 960px) {
  main.kbd-container {
    grid-template-columns: 1fr;
    padding: 3rem 2rem 4rem;
  }

  .kbd-sidebar {
    position: static;
    max-width: 100%;
    margin-bottom: 3rem;
    gap: 2rem;
  }

  .kbd-detail-cards {
    max-width: 100%;
    gap: 1.8rem;
  }

  .kbd-images-row {
    flex-direction: column;
  }

  .kbd-image-large,
  .kbd-image-small-column {
    flex: 1 1 100%;
  }

  .kbd-metrics-section {
    flex-direction: row;
    justify-content: space-between;
    gap: 1.5rem;
  }

  .kbd-form-row {
    grid-template-columns: 1fr;
  }

  .kbd-author-bio-card {
    flex-direction: column;
    text-align: center;
    align-items: center;
  }

  .kbd-bio-top {
    flex-direction: column;
    align-items: center;
  }

  .kbd-bio-desc {
    text-align: center;
  }
}

@media (max-width: 768px) {
  .kblog-progress-sidebar {
    display: none;
  }

  .kbd-cta-band {
    padding: 3.5rem 1.5rem;
  }
}

@media (max-width: 480px) {
  .kbd-blog-title {
    font-size: 2.8rem;
  }

  .kbd-section-title {
    font-size: 1.7rem;
  }

  .kbd-info-bar {
    padding: 1.8rem 2rem;
  }

  .kbd-info-block {
    padding: 1rem 1.4rem;
  }
}
