/* 1. Hide social share bars inside related/similar post cards */
.related-posts .share-links,
.similar-posts .sd-sharing,
.entry-related .share-links-container {
    display: none !important;
}

/* 2. Hide duplicate modified dates when identical to published date */
.single-post .updated:not(.published) {
    display: none !important;
}

/* 3. Hide redundant Jetpack related posts block */
#jp-relatedposts {
    display: none !important;
}

/* ====
   1. CONTAINER & READING WIDTH OPTIMIZATION
   ==== */

/* Keeps article reading line lengths comfortable (50-75 chars/line) */
article {
  max-width: 740px !important;
  margin: 0 auto !important;
  padding: 0 1.25rem !important;
  box-sizing: border-box;
}

/* Ensure full site containers don't create unwanted horizontal scrolling */
body, html {
  overflow-x: hidden;
}

/* ==================================
   2. FLUID TYPOGRAPHY & SPACING  ================================== */

/* Dynamic Title Sizing: Scales smoothly from mobile to desktop */
article header h1 {
  font-size: clamp(1.8rem, 4vw + 0.5rem, 2.75rem) !important;
  line-height: 1.25 !important;
  margin-bottom: 1rem !important;
}

article h2 {
  font-size: clamp(1.35rem, 2.5vw + 0.5rem, 1.85rem) !important;
  line-height: 1.3 !important;
  margin-top: 2.25rem !important;
  margin-bottom: 1rem !important;
}

/* Article Body Text */
article p, 
article li {
  font-size: 1.0625rem; /* ~17px for high readability */
  line-height: 1.7;
  color: #2d3748;
}

article ul, 
article ol {
  padding-left: 1.5rem;
  margin-bottom: 1.5rem;
}

article li {
  margin-bottom: 0.5rem;
}

/* Callout Quotes */
article blockquote {
  border-left: 4px solid #10b981; /* Accent color */
  margin: 2rem 0;
  padding: 0.75rem 1.25rem;
  background-color: #f8fafc;
  font-style: italic;
  border-radius: 0 8px 8px 0;
}

article blockquote p {
  margin-bottom: 0.25rem;
  font-size: 1.125rem;
}

/* ===
3. RESPONSIVE IMAGES & FIGURE FIXES 
==== */

/* Prevent tall vertical graphics from dominating the viewport */
article figure {
  margin: 1.75rem 0 !important;
  text-align: center;
}

article img {
  max-width: 100% !important;
  height: auto !important;
  border-radius: 8px;
}

/* Constrain oversized vertical inline illustrations */
article figure img {
  max-height: 480px; /* Caps extreme portrait height */
  object-fit: contain;
  width: auto;
  margin: 0 auto;
}

article figcaption {
  font-size: 0.875rem;
  color: #64748b;
  margin-top: 0.5rem;
  font-style: italic;
}

/* On Desktop (768px+), float/align smaller figures inline with text if needed */
@media (min-width: 768px) {
  article figure.alignleft {
    float: left;
    margin: 0.5rem 1.5rem 1rem 0 !important;
    max-width: 320px;
  }
  
  article figure.alignright {
    float: right;
    margin: 0.5rem 0 1rem 1.5rem !important;
    max-width: 320px;
  }
}

/* Clear floating elements */
article::after {
  content: "";
  display: table;
  clear: both;
}

/* ==================================
   4. RESPONSIVE TABLE FIX (Section 5) ==================================*/

/* Wrap tables to enable smooth touch scrolling on mobile */
article figure:has(table),
.table-container {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 2rem 0;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

article table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.95rem;
}

article th {
  background-color: #f1f5f9;
  color: #0f172a;
  font-weight: 600;
  padding: 0.875rem 1rem;
  border-bottom: 2px solid #cbd5e1;
}

article td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: top;
}

article tr:last-child td {
  border-bottom: none;
}

article tr:nth-child(even) {
  background-color: #f8fafc;
}

/* ==================================
   5. MOBILE TOUCH TARGETS & NAVIGATION ENHANCEMENTS  ================================== */

@media (max-width: 767px) {
  /* Increase touch target sizes for mobile links & menu buttons */
  nav a, 
  header a,
  .mobile-menu a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
  }

  /* Prevent meta date/author text from awkwardly wrapping */
  article header div {
    font-size: 0.875rem;
    color: #64748b;
  }
}

/*Let full-width page templates expand */
body.page-template-full-width article {
  max-width: 100% !important;
}

/* Force any full-width Kadence row missing the theme content-width class 
   to match the site's standard 1290px column, like the hero and footer rows */
.kb-row-layout-wrap.alignfull .kt-row-column-wrap:not(.kb-theme-content-width) {
    max-width: var(--global-content-width, 1290px);
    margin-left: auto;
    margin-right: auto;
}