/**
 * TECHi Single Post Design Enhancements
 * Global post styles: Key Takeaways, Sticky Sidebar, Author Box, Readability, Links, FAQs
 * @version 2.0.0 — Gold-specific CSS moved to ACF Post Custom CSS field
 */

/* ==========================================================================
   1. KEY TAKEAWAYS BOX
   ========================================================================== */

.techi-key-takeaways {
  background: linear-gradient(135deg, #f8f9fa 0%, #fff 100%);
  border: 1px solid #e2e8f0;
  border-left: 4px solid #1a56db;
  border-radius: 8px;
  padding: 24px 28px;
  margin: 24px 0 32px;
  font-size: 0.95rem;
  line-height: 1.7;
}

.techi-key-takeaways h3 {
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #1a56db;
  margin: 0 0 14px;
  padding: 0;
}

.techi-key-takeaways ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.techi-key-takeaways ul li {
  position: relative;
  padding: 6px 0 6px 20px;
  border-bottom: 1px solid #f0f0f0;
}

.techi-key-takeaways ul li:last-child {
  border-bottom: none;
}

.techi-key-takeaways ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 14px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #1a56db;
}

.techi-key-takeaways ul li strong {
  color: #1e293b;
}

/* ==========================================================================
   6. STICKY SIDEBAR
   ========================================================================== */

@media (min-width: 992px) {
  .single-post-main .one-third-lg {
    position: -webkit-sticky;
    position: sticky;
    top: 80px;
    align-self: flex-start;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
  }
}

/* ==========================================================================
   7. IMPROVED AUTHOR BOX
   ========================================================================== */

.blog-author-main {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 24px 28px !important;
}

.blog-author-main .blog-author-image img {
  width: 80px;
  height: 80px;
  border: 3px solid #e2e8f0;
}

.blog-author-main h4 a {
  font-size: 1.1rem;
}

.blog-author-main .author-desc {
  font-size: 0.9rem !important;
  line-height: 1.65;
}

/* ==========================================================================
   8. IMPROVED POST CONTENT READABILITY
   ========================================================================== */

.post-content.entry-content p {
  margin-bottom: 1.4em;
  line-height: 1.78;
}

.post-content.entry-content h2 {
  margin-top: 2.2em;
  margin-bottom: 0.8em;
  padding-top: 0.8em;
  border-top: 1px solid #f1f5f9;
  scroll-margin-top: 80px;
}

.post-content.entry-content h2:first-child {
  border-top: none;
  margin-top: 0;
  padding-top: 0;
}

/* Better visual separation for bold-label paragraphs (Why Gold Prices Move section) */
.post-content.entry-content p > strong:first-child {
  display: inline-block;
  margin-top: 0.3em;
}

/* ==========================================================================
   9. DISCLOSURE PLACEMENT FIX (move before share, reduce visual weight)
   ========================================================================== */

.blog-disclosure {
  font-size: 0.82rem;
  padding: 12px 16px !important;
  border-radius: 6px;
  background: #fafafa !important;
  border-color: #e5e7eb !important;
  color: #6b7280;
  margin-top: 8px !important;
  margin-bottom: 16px !important;
}

.blog-disclosure strong {
  color: #4b5563;
}

/* ==========================================================================
   10. TAGS CLEANUP
   ========================================================================== */

.blog-tags .badge {
  font-size: 0.8rem;
  padding: 5px 10px;
  font-weight: 500;
  border: 1px solid #e2e8f0;
  transition: background 0.15s;
}

.blog-tags .badge:hover {
  background: #f1f5f9;
}

/* ==========================================================================
   11. REMOVE H2/H3 "LABEL" TEXT (debug artifact)
   The ::before pseudo-elements show "H2"/"H3" text centered on the divider.
   This overrides those to remove the text label while keeping the border-top.
   ========================================================================== */

.post-content.entry-content h2::before,
.post-content.entry-content h3:not(.rank-math-question)::before {
  content: none !important;
  display: none !important;
}

/* ==========================================================================
   12. LINK VISIBILITY — Make links clearly distinct from body text
   Current --primary-accessible (#006d6b) is too close to body text.
   Using a brighter teal that's still accessible (4.5:1 contrast ratio).
   ========================================================================== */

.post-content.entry-content a:not(.btn):not(.wp-block-button__link) {
  color: #0d7377 !important;
  text-decoration: underline !important;
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px !important;
  text-decoration-color: rgba(13, 115, 119, 0.4) !important;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

.post-content.entry-content a:not(.btn):not(.wp-block-button__link):hover {
  color: #065f61 !important;
  text-decoration-color: #065f61 !important;
  text-decoration-thickness: 2px !important;
}

/* Internal TECHi links — subtle arrow icon to encourage exploration */
.post-content.entry-content a[href*="techi.com"]:not(.btn):not(.wp-block-button__link)::after {
  content: " \2197";
  font-size: 0.7em;
  vertical-align: super;
  opacity: 0.5;
  text-decoration: none;
  display: inline;
}

/* External links — subtle external icon */
.post-content.entry-content a[target="_blank"]::after {
  content: " \2197";
  font-size: 0.7em;
  vertical-align: super;
  opacity: 0.4;
  text-decoration: none;
}

/* Don't double-add icon to TECHi links that also have target=_blank */
.post-content.entry-content a[href*="techi.com"][target="_blank"]::after {
  content: " \2197";
  opacity: 0.5;
}

/* ==========================================================================
   13. FAQ ACCORDION STYLING IMPROVEMENT
   ========================================================================== */

.wp-block-rank-math-faq-block .rank-math-list-item {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  margin-bottom: 8px;
  overflow: hidden;
  transition: box-shadow 0.15s;
}

.wp-block-rank-math-faq-block .rank-math-list-item:hover {
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.wp-block-rank-math-faq-block .rank-math-question {
  padding: 16px 20px;
  font-weight: 600;
}

.wp-block-rank-math-faq-block .rank-math-answer {
  padding: 0 20px 16px;
  line-height: 1.7;
  color: #475569;
}

/* ==========================================================================
   14. HOMEPAGE SECTION DIVIDERS
   Stronger visual separation between category sections on homepage.
   ========================================================================== */

.techi-archive-sections .section-heading,
.techi-magazine-hero + .py-5,
section.py-5 + section.py-5 {
  border-top: 2px solid #f1f5f9;
  padding-top: 2rem;
}

/* Category section labels — stronger presence */
.section-start-heading,
.techi-section-header h2 {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  position: relative;
  padding-bottom: 10px;
  margin-bottom: 24px;
}

.section-start-heading::after,
.techi-section-header h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 40px;
  height: 3px;
  background: var(--primary-color, #00b0ae);
  border-radius: 2px;
}

/* ==========================================================================
   15. TRENDING SECTION CARD IMAGE FIX
   Ensure all thumbnails render at consistent aspect ratio.
   ========================================================================== */

.small-featured-post {
  display: flex;
  align-items: stretch;
  gap: 16px;
}

.small-featured-image {
  flex-shrink: 0;
  width: 120px;
  height: 90px;
  overflow: hidden;
  border-radius: 8px;
}

.small-featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ==========================================================================
   16. AUTHOR BOX ENHANCEMENT — "More articles" link
   ========================================================================== */

.blog-author-main .blog-author-details {
  position: relative;
}

.blog-author-main h4 a::after {
  content: " \2192 View all articles";
  font-size: 0.75rem;
  font-weight: 400;
  color: #94a3b8;
  margin-left: 8px;
  text-decoration: none;
}

.blog-author-main h4 a:hover::after {
  color: var(--primary-color, #00b0ae);
}

/* ==========================================================================
   17. PARAGRAPH SPACING — MOBILE REFINEMENT
   ========================================================================== */

/* ==========================================================================
   21. MOBILE REFINEMENTS
   ========================================================================== */

@media (max-width: 768px) {
  .post-content.entry-content p {
    margin-bottom: 1.2em;
    font-size: 1rem;
    line-height: 1.75;
  }

  .techi-key-takeaways {
    padding: 18px 20px;
    margin: 16px 0 24px;
  }
}
