/* ————————————————
   LIGHT MODE — ARTICLE TOP
——————————————— */

:root {
  --bg: #F8FAFC;              /* soft off-white */
  --panel: #FFFFFF;
  --text: #0F1A1F;
  --muted: #64748B;
  --accent: hsl(168, 76%, 42%); /* brand green */
  --accent-soft: rgba(0, 201, 130, 0.12);
  --accent-soft2: rgba(0, 201, 130, 0.06);
  --glow: 0 0 32px rgba(0, 201, 130, 0.18);

  /* Brand colors */
  --fb-blue: #1877F2;
  --insta-gradient: linear-gradient(45deg, #F58529, #DD2A7B, #8134AF, #515BD4);
  --x-color: #0F1A1F;
  --linkedin-blue: #0A66C2;
}

/* Wrapper */
.top-section {
  margin-bottom: 32px;
  background: var(--bg);
}

/* Container */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}

/* Top meta */
.article-meta-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}


.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  align-items: center;
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 16px;
}

.meta-details {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--muted);
}

/* Category Pill */
.category {
  background: linear-gradient(
    180deg,
    var(--accent-soft),
    var(--accent-soft2)
  );
  padding: 7px 16px;
  border-radius: 50px;
  color: var(--accent);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.5px;
  border: 1px solid rgba(0, 201, 130, 0.2);
}

/* Title */
h1 {
  font-size: 3rem;
  font-weight: 700;
  line-height: 1.1;
  margin: 4px 0 24px;
  color: var(--text);
  letter-spacing: -0.015em;
  max-width: 900px;
}

@media (max-width: 768px){
  h1 {
    font-size: 2rem;
    font-weight: 500;
  }
}

/* Author block */
.author {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 24px;
}

.avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(180deg, #E6F7F1, #FFFFFF);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 16px;
  color: var(--accent);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

/* Author info */
.author-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.author-info .name {
  font-weight: 700;
  font-size: 16px;
  color: var(--text);
}

.author-info .role {
  font-size: 13px;
  color: var(--muted);
}

/* Author socials */
.author-social {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.social-link {
  display: inline-flex;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--panel);
  border: 1px solid rgba(0, 0, 0, 0.1);
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease-in-out;
}

.social-link svg {
  width: 18px;
  height: 18px;
  stroke: var(--muted);
  transition: stroke 0.2s, filter 0.2s;
}

.social-link:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: var(--glow);
}

/* Brand hover colors */
.social-link.facebook:hover svg {
  stroke: var(--fb-blue);
}

.social-link.instagram:hover svg {
  stroke: var(--accent);
}

.social-link.x:hover svg {
  stroke: var(--x-color);
}

.social-link.linkedin:hover svg {
  stroke: var(--linkedin-blue);
}

/* Divider */
.article-divider {
  border: none;
  height: 2px;
  width: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(0, 201, 130, 0.55),
    transparent
  );
  margin: 24px 0;
  border-radius: 4px;
}

/* Back to top */
#backToTop {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 45px;
  height: 45px;
  border: none;
  border-radius: 50%;
  background: var(--panel);
  color: var(--text);
  font-size: 24px;
  cursor: pointer;
  display: none;
  justify-content: center;
  align-items: center;
  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 999;
}

#backToTop.show {
  display: flex;
  opacity: 1;
  transform: translateY(0);
}

#backToTop.hide {
  opacity: 0;
  transform: translateY(20px);
}


.meta {
  display: flex;
  flex-wrap: wrap;
  column-gap: 32px; /* horizontal spacing */
  row-gap: 10px;    /* vertical spacing when it wraps */
  align-items: center;
}

.meta-details {
  display: flex;
  flex-wrap: wrap;
  column-gap: 16px;
  row-gap: 8px;
  font-size: 14px;
  color: var(--muted);
}


/* ===============================
   STICKY ARTICLE BAR — LIGHT MODE
   =============================== */

.sticky-article-bar {
  margin: 1rem auto 0;
  max-width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;

  padding: 1rem 1.25rem;
  gap: 1.5rem;

  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.92),
    rgba(248, 250, 252, 0.98)
  );

  border: 1px solid var(--border);
  border-radius: 14px;

  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.08),
    inset 0 0 0 1px rgba(0, 201, 130, 0.04);

  backdrop-filter: blur(6px);
}


/* Layout */
.left-side,
.right-side {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.left-side span,
.right-side span {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted-foreground);
}


/* Icons */
.ai-icons,
.share-icons {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.ai-icons a,
.share-icons a {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;

  background: rgba(0, 0, 0, 0.02);
  border: 1px solid rgba(0, 0, 0, 0.08);

  transition: transform 0.2s, background 0.2s, box-shadow 0.2s;
}

.ai-icons a:hover,
.share-icons a:hover {
  background: rgba(0, 201, 130, 0.08);
  box-shadow: 0 4px 12px rgba(0, 201, 130, 0.18);
}

.ai-icons img,
.share-icons svg {
  width: 20px;
  height: 20px;
  color: var(--foreground);
}




/* ===============================
   MOBILE
   =============================== */

@media (max-width: 768px) {
  .sticky-article-bar {
    bottom: 1rem;
    z-index: 50;
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }

  .left-side,
  .right-side {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}


/* ===============================
   DESKTOP ALIGNMENT
   =============================== */

@media (min-width: 1024px) {
  .sticky-article-bar {
    max-width: calc(100% - 16rem);
    margin-left: auto;
    margin-right: 0;
  }
}


/* ===============================
   MOBILE LABEL TUNING
   =============================== */

@media (max-width: 768px) {
  .left-side span,
  .right-side span {
    display: block;
    font-size: 0.65rem;
    letter-spacing: 0.12em;
    color: var(--muted-foreground);
  }
}

@media (max-width: 768px) {
  .left-side,
  .right-side {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}


/* ===============================
   SPACING FIXES — ARTICLE END
   =============================== */

.main-content > article > .section:last-of-type {
  margin-bottom: 0.75rem;
}

.main-content > article > .section:last-of-type .cta-card {
  margin-bottom: 0;
}


/* ===============================
   MOBILE SPACING TIGHTENING
   =============================== */

@media (max-width: 768px) {
  .sticky-article-bar {
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }

  .left-side,
  .right-side {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .left-side span,
  .right-side span {
    display: block;
    font-size: 0.6rem;
    letter-spacing: 0.12em;
    color: var(--muted-foreground);
  }
}


/* ===============================
   DESKTOP WIDTH OVERRIDE
   =============================== */

@media (min-width: 1024px) {
  .sticky-article-bar {
    max-width: calc(100% - 18.5rem);
    margin-left: auto;
  }
}


/* ===============================
   FINAL ARTICLE CLEANUP
   =============================== */

.main-content article {
  margin-bottom: 0;
  padding-bottom: 0;
}

.section:last-child {
  margin-bottom: 0;
}

.section:last-child .cta-card {
  margin-bottom: 0;
}

@media (max-width: 768px) {
  .section:last-child + .separator,
  .section:last-child hr {
    margin-bottom: 0;
  }
}

@media (max-width: 768px) {
  .main-content article {
    margin-bottom: 0;
    padding-bottom: 0;
  }

  .section:last-child {
    margin-bottom: 0;
  }

  .section:last-child .cta-card {
    margin-bottom: 0;
  }

  .sticky-article-bar {
    margin-top: 0;
  }
}

/* TOAST */
.toast {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #111;
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  opacity: 0;
  transition: all .3s ease;
  z-index: 999999;
  font-size: 14px;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}



.ai-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.65);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 99999;
  backdrop-filter: blur(4px);
}

.ai-modal-content {
  background: #111;
  padding: 25px;
  border-radius: 12px;
  width: 90%;
  max-width: 350px;
  text-align: center;
  position: relative;
  box-shadow: 0 6px 20px rgba(0,0,0,0.5);
  animation: popIn 0.25s ease-out;
}

@keyframes popIn {
  from { transform: scale(0.85); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.close-modal {
  position: absolute;
  top: 8px;
  right: 10px;
  background: none;
  border: none;
  font-size: 24px;
  color: #aaa;
  cursor: pointer;
  transition: 0.2s;
}



.continue-btn {
  background: linear-gradient(135deg, #00C982, #00E4FF);
  color: white;
  border: none;
  padding: 10px 18px;
  font-size: 15px;
  border-radius: 8px;
  cursor: pointer;
  width: 100%;
  margin-top: 18px;
  transition: background 0.2s;
}

.continue-btn:hover {
  filter: brightness(1.1);
    transform: translateY(-2px);
}


.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #333;
  color: black;
  padding: 0.8rem 1.2rem;
  border-radius: 6px;
  font-size: 0.875rem;
  opacity: 0;
  pointer-events: none;
  
  z-index: 9999;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}


.ai-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.ai-modal.active {
  display: flex;
}

.ai-modal-content {
  background: #fff;
  padding: 2rem;
  border-radius: 8px;
  max-width: 400px;
  width: 90%;
  text-align: center;
  position: relative;
}

.ai-modal .close-modal {
  position: absolute;
  top: 10px;
  right: 10px;
  background: transparent;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
}


.note-box {
  padding: 1.2rem 1.4rem;
  border-radius: 10px;
  margin-bottom: 1.8rem;
}

.note-box-info {
  background-color: rgba(59, 130, 246, 0.08);
  border-left: 4px solid #00C982;
}
