/* ========================================
   UXLAB POSTS - posts.css
   FIXED: Mobile table hiding + responsive
======================================== */

/* MOBILE TABLE HIDE - FIRST RULE (CRITICAL) */
@media screen and (max-width: 768px) {
  .desktop-only-tables,
  .desktop-only-tables * {
    display: none !important;
  }
  .mobile-download-btn {
    display: block !important;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%) !important;
    color: white !important;
    padding: 1.5rem 2rem !important;
    margin: 2rem auto !important;
    text-align: center !important;
    border-radius: 12px !important;
    text-decoration: none !important;
    font-weight: 700 !important;
    font-size: 1.1rem !important;
    box-shadow: 0 8px 25px rgba(59,130,246,0.4) !important;
    max-width: 320px !important;
    transition: all 0.3s ease !important;
  }
  .mobile-download-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 12px 35px rgba(59,130,246,0.5) !important;
  }
}

@media screen and (min-width: 769px) {
  .mobile-download-btn {
    display: none !important;
  }
}

/* Global Reset & Typography */
* {
  box-sizing: border-box;
}

body {
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
  color: #222222;
}

/* Page Layout */
.page-container {
  padding-top: 3rem;
  max-width: 1200px;
  margin: 0 auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.article-shell {
  max-width: 960px;
  margin: 2rem auto;
  padding: 2rem;
  background: #ffffff;
}

/* Article Content */
.article-body {
  color: #222222;
}

.article-body h1 { margin-top: 0; margin-bottom: 2rem; font-size: 2.5rem; font-weight: 700; }
.article-body h2 { margin: 3rem 0 1rem 0; font-size: 2rem; font-weight: 600; }
.article-body h3 { margin: 2.5rem 0 1rem 0; font-size: 1.5rem; font-weight: 600; }

.article-body p {
  margin-bottom: 1.25rem;
}

/* Responsive Images */
.article-body img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 2rem auto;
}

.article-body figure {
  margin: 2.5rem 0;
}

.article-body figcaption {
  text-align: center;
  font-size: 0.9rem;
  color: #6b7280;
  margin-top: 0.5rem;
}

/* Responsive Tables */
.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-size: 0.95rem;
}

.article-body th,
.article-body td {
  padding: 0.75rem;
  text-align: left;
  border: 1px solid #e5e7eb;
  vertical-align: top;
}

.article-body th {
  background: #f9fafb;
  font-weight: 600;
}

/* Table Scroll Wrapper */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 2rem 0;
  border-radius: 0.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* Lists */
.article-body ul,
.article-body ol {
  margin: 1.5rem 0;
  padding-left: 2rem;
}

.article-body li {
  margin-bottom: 0.5rem;
}

/* Blockquotes */
.article-body blockquote {
  border-left: 4px solid #3b82f6;
  padding: 1rem 1.5rem;
  margin: 2rem 0;
  background: #eff6ff;
  font-style: italic;
}

/* Highlight Lines */
.article-body .highlight-line {
  color: #ff7a1a;
  font-weight: 600;
  background: rgba(255, 122, 26, 0.1);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  display: inline-block;
}

/* Posts Index */
.posts-index-header h1 {
  margin-bottom: 0.5rem;
}

.posts-index-list {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  padding-bottom: 3rem;
}

.post-card {
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 2rem;
}

.post-card:last-child {
  border-bottom: none;
}

.post-card-link {
  color: inherit;
  text-decoration: none;
}

.post-card-link:hover h2 {
  color: #3b82f6;
  text-decoration: underline;
}

.post-meta {
  font-size: 0.85rem;
  color: #6b7280;
  margin: 0.5rem 0 1rem;
}

.post-excerpt {
  margin: 0 0 1rem;
  color: #374151;
  font-size: 0.95rem;
}

.post-cta a {
  font-size: 0.9rem;
  color: #2563eb;
  text-decoration: none;
}

.post-cta a:hover {
  text-decoration: underline;
}

/* Footers */
.article-footnote,
.site-footer {
  max-width: 1080px;
  margin: 3rem auto 0;
  text-align: center;
  font-size: 0.9rem;
  color: #6b7280;
  padding: 1rem;
}

.article-footnote p {
  margin: 0;
}

/* MOBILE RESPONSIVE */
@media (max-width: 768px) {
  .page-container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  .article-shell {
    padding: 1.5rem 1rem;
    margin: 1rem auto;
  }
  
  .article-body h1 { font-size: 2rem; }
  .article-body h2 { font-size: 1.75rem; }
  .article-body h3 { font-size: 1.25rem; }
  
  .article-body table {
    font-size: 0.85rem;
    min-width: 600px;
  }
  
  .article-body th,
  .article-body td {
    padding: 0.5rem 0.4rem;
  }
 
}

@media (max-width: 480px) {
  .article-body {
    font-size: 0.95rem;
    
  }
 
  .table-wrapper {
    border-radius: 0;
    box-shadow: none;
    margin: 1.5rem -1rem;
  }
}

/* FORCE WebP responsive scaling */
.article-body img[src$=".webp"],
.article-body img[src$=".jpg"],
.article-body img[src$=".png"] {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    display: block !important;
    margin: 2rem auto !important;
    object-fit: contain;
}
