/* ============================================
   COMMON BLOG POST STYLES - For all blog posts
   Link this file in any new post: 
   <link rel="stylesheet" href="../post-styles.css">
   ============================================ */

/* ---------- Base & Reset ---------- */
.blog-post-section {
  display: block;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  min-height: 100vh;
}

/* ---------- Navigation ---------- */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #3b82f6;
  text-decoration: none;
  font-weight: 500;
  margin-bottom: 2rem;
  padding: 0.5rem 1rem;
  background: white;
  border-radius: 30px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  transition: all 0.2s ease;
}

.back-link:hover {
  transform: translateX(-5px);
  background: #eff6ff;
}

/* ---------- Post Header ---------- */
.post-header {
  text-align: center;
  margin-bottom: 2rem;
}

.post-title {
  font-size: 2.5rem;
  font-weight: 800;
  color: #1e293b;
  margin-bottom: 1rem;
  line-height: 1.3;
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.post-meta {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  color: #64748b;
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.post-meta i {
  color: #3b82f6;
  margin-right: 0.3rem;
}

.category-tag {
  background: #e2e8f0;
  padding: 0.3rem 1rem;
  border-radius: 30px;
  font-size: 0.85rem;
  color: #475569;
  display: inline-block;
}

/* ---------- Main Content ---------- */
.post-content {
  background: white;
  padding: 3rem;
  border-radius: 30px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.05);
  margin: 2rem 0;
}

.post-content h2 {
  font-size: 2rem;
  color: #1e293b;
  margin: 2.5rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 3px solid;
  border-image: linear-gradient(90deg, #3b82f6, #8b5cf6) 1;
  border-bottom-style: solid;
  border-bottom-width: 3px;
  border-image-slice: 1;
}

.post-content h2:first-of-type {
  margin-top: 0;
}

.post-content h3 {
  font-size: 1.5rem;
  color: #334155;
  margin: 2rem 0 1rem;
}

.post-content h4 {
  font-size: 1.2rem;
  color: #475569;
  margin: 1.5rem 0 0.8rem;
}


.post-content p { line-height: 1.8; color: #475569; margin-bottom: 1.2rem; font-size: 1.05rem; text-align: justify; text-indent: 2em; }
.post-content strong {
  color: #3b82f6;
  font-weight: 600;
}

.post-content ul, 
.post-content ol {
  margin: 1rem 0 1.5rem 1.5rem;
}

.post-content li {
  line-height: 1.8;
  color: #475569;
  margin-bottom: 0.5rem;
  font-size: 1.05rem;
}

.post-content li::marker {
  color: #3b82f6;
}

.post-content hr {
  margin: 2.5rem 0;
  border: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, #cbd5e1, transparent);
}

/* ---------- Images ---------- */
.hero-image {
  position: relative;
  width: 100%;
  height: 450px;
  overflow: hidden;
}

.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;   /* fills container, no black space */
  object-position: center;
  display: block;
}

.hero-caption {
  position: absolute;
  bottom: 12px;
  left: 15px;
  color: #fff;
  font-size: 16px;
  background: rgba(0,0,0,0.6);
  padding: 6px 10px;
  border-radius: 4px;
}

.feature-image {
  margin: 2rem 0 3rem;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  position: relative;
}

.feature-image img {
  width: 100%;
  height: auto;
  max-height: 450px;
  object-fit: cover;
  transition: transform 0.5s ease;
  display: block;
}

.feature-image:hover img {
  transform: scale(1.02);
}

.feature-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
  color: white;
  padding: 2rem 2rem 1rem;
  font-size: 0.9rem;
  font-style: italic;
}

.image-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin: 2rem 0;
}

.image-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin: 2rem 0;
}

.grid-item {
  background: white;
  padding: 1rem;
  border-radius: 16px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
  border: 1px solid #f1f5f9;
}

.grid-item img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 12px;
  transition: transform 0.3s ease;
}

.grid-item:hover img {
  transform: scale(1.02);
}

.grid-item .image-caption {
  margin-top: 0.8rem;
  text-align: center;
  font-size: 0.85rem;
  color: #64748b;
  font-style: italic;
}

.float-image-left {
  float: left;
  width: 300px;
  margin: 0.5rem 2rem 1rem 0;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  transition: transform 0.3s ease;
}

.float-image-right {
  float: right;
  width: 280px;
  margin: 0.5rem 0 1rem 2rem;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  transition: transform 0.3s ease;
}

.float-image-left:hover,
.float-image-right:hover {
  transform: scale(1.02);
}

.full-width-image {
  margin: 2rem 0;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.full-width-image img {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
}

/* ---------- Tables ---------- */
.table-container {
  overflow-x: auto;
  margin: 2rem 0;
  border-radius: 16px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  font-size: 0.95rem;
}

th {
  background: #1e293b;
  color: white;
  font-weight: 600;
  padding: 1rem;
  text-align: left;
}

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

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

tr:hover {
  background: #f1f5f9;
}

.table-caption {
  font-size: 0.9rem;
  color: #64748b;
  margin-top: 0.5rem;
  font-style: italic;
}

/* ---------- Cards & Boxes ---------- */
.info-box {
  background: linear-gradient(135deg, #eff6ff 0%, #eef2ff 100%);
  border-radius: 16px;
  padding: 2rem;
  margin: 2rem 0;
  border-left: 6px solid #3b82f6;
  clear: both;
}

.info-box h4 {
  color: #1e293b;
  margin-bottom: 1rem;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.note-box {
  background: #f1f5f9;
  padding: 1.5rem;
  border-radius: 16px;
  margin: 1.5rem 0;
  border-left: 6px solid #8b5cf6;
}

.highlight-box {
  background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
  padding: 2rem;
  border-radius: 20px;
  margin: 2rem 0;
  border-left: 6px solid #0891b2;
}

.legal-card {
  background: #f8fafc;
  padding: 2rem;
  border-radius: 16px;
  margin: 2rem 0;
  border-left: 6px solid #8b5cf6;
  box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

/* ---------- Grid Layouts ---------- */
.function-grid,
.benefits-grid,
.requirement-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.function-card,
.benefit-card,
.requirement-card {
  background: #f8fafc;
  padding: 1.8rem;
  border-radius: 20px;
  border-left: 6px solid;
  transition: all 0.3s ease;
  box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.function-card:hover,
.benefit-card:hover,
.requirement-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(59, 130, 246, 0.15);
}

.function-card:nth-child(odd) { border-left-color: #3b82f6; }
.function-card:nth-child(even) { border-left-color: #8b5cf6; }

.function-card h4,
.benefit-card h4,
.requirement-card h4 {
  font-size: 1.3rem;
  color: #1e293b;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.function-card p,
.benefit-card p,
.requirement-card p {
  font-size: 0.95rem;
  margin-bottom: 0;
  color: #475569;
}

/* ---------- Two Column Layout ---------- */
.two-column {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin: 2rem 0;
}

.column-item {
  background: #f8fafc;
  padding: 1.8rem;
  border-radius: 16px;
}

/* ---------- Badges ---------- */
.badge {
  display: inline-block;
  padding: 0.3rem 1rem;
  border-radius: 30px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
}

.badge-blue {
  background: #e0f2fe;
  color: #0369a1;
}

.badge-green {
  background: #dcfce7;
  color: #166534;
}

.badge-purple {
  background: #f3e8ff;
  color: #6b21a8;
}

.badge-red {
  background: #fee2e2;
  color: #b91c1c;
}

.badge-yellow {
  background: #fef9c3;
  color: #854d0e;
}

.major-badge {
  background: #fee2e2;
  color: #b91c1c;
  padding: 0.2rem 0.8rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  display: inline-block;
}

.minor-badge {
  background: #fef9c3;
  color: #854d0e;
  padding: 0.2rem 0.8rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  display: inline-block;
}

.eco-badge {
  background: #86efac;
  color: #166534;
  padding: 0.3rem 1rem;
  border-radius: 30px;
  font-weight: 600;
  display: inline-block;
}

/* ---------- Tags ---------- */
.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 2rem 0;
}

.post-tag {
  background: #e2e8f0;
  padding: 0.3rem 1rem;
  border-radius: 30px;
  font-size: 0.85rem;
  color: #475569;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.post-tag:hover {
  background: #3b82f6;
  color: white;
}

/* ---------- Share Section ---------- */
.share-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 3rem 0 2rem;
  padding: 2rem;
  background: white;
  border-radius: 20px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.share-title {
  color: #1e293b;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.share-buttons {
  display: flex;
  gap: 0.8rem;
}

.share-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  transition: all 0.2s ease;
  text-decoration: none;
}

.share-btn:hover {
  transform: translateY(-5px);
}

.share-btn.facebook { background: #1877f2; }
.share-btn.twitter { background: #1da1f2; }
.share-btn.linkedin { background: #0a66c2; }
.share-btn.whatsapp { background: #25d366; }

/* ---------- Summary Box ---------- */
.summary-box {
  background: #1e293b;
  color: white;
  padding: 2.5rem;
  border-radius: 24px;
  margin: 3rem 0;
}

.summary-box p {
  color: #e2e8f0;
  font-size: 1.1rem;
  line-height: 1.8;
}

.summary-box strong {
  color: #bae6fd;
}

/* ---------- Section Reference ---------- */
.section-ref {
  font-family: monospace;
  background: #1e293b;
  color: #f1f5f9;
  padding: 0.2rem 0.8rem;
  border-radius: 20px;
  display: inline-block;
  font-size: 0.9rem;
}

/* ---------- Inspection Row ---------- */
.inspection-row {
  display: flex;
  gap: 1rem;
  align-items: center;
  background: #f1f5f9;
  padding: 1rem;
  border-radius: 12px;
  margin: 1rem 0;
  flex-wrap: wrap;
}

.inspection-label {
  font-weight: 700;
  min-width: 150px;
  color: #1e293b;
}

.inspection-value {
  color: #3b82f6;
  font-family: monospace;
  font-size: 1.1rem;
}

/* ---------- Structure Box ---------- */
.structure-box {
  background: #1e293b;
  color: white;
  padding: 2rem;
  border-radius: 16px;
  text-align: center;
  margin: 2rem 0;
  position: relative;
  overflow: hidden;
}

.structure-box::before {
  content: "⚛️";
  font-size: 5rem;
  opacity: 0.1;
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
}

.molecule-name {
  font-family: monospace;
  font-size: 1.2rem;
  color: #bae6fd;
}

/* ---------- Definition Box ---------- */
.definition-box {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin: 2rem 0;
}

.def-item {
  background: #f1f5f9;
  padding: 1.5rem;
  border-radius: 16px;
  transition: all 0.3s ease;
}

.def-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(139, 92, 246, 0.15);
}

.def-item h4 {
  color: #8b5cf6;
  margin-bottom: 1rem;
  font-size: 1.2rem;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 0.5rem;
}

.def-item .example {
  background: white;
  padding: 0.8rem;
  border-radius: 8px;
  margin-top: 1rem;
  font-style: italic;
  color: #475569;
  border-left: 3px solid #8b5cf6;
}

/* ---------- Procedure List ---------- */
.procedure-list {
  list-style: none;
  padding: 0;
}

.procedure-list li {
  padding: 0.8rem 0 0.8rem 2rem;
  position: relative;
  border-bottom: 1px solid #f1f5f9;
}

.procedure-list li:before {
  content: "⚖️";
  position: absolute;
  left: 0;
  color: #8b5cf6;
}

/* ---------- Meter Types ---------- */
.meter-types {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin: 2rem 0;
  clear: both;
}

.meter-type-card {
  background: #f8fafc;
  padding: 2rem;
  border-radius: 20px;
  text-align: center;
  transition: all 0.3s ease;
  border: 1px solid #e2e8f0;
}

.meter-type-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(0,0,0,0.1);
  border-color: #3b82f6;
}

.meter-type-card i {
  font-size: 3rem;
  color: #3b82f6;
  margin-bottom: 1rem;
}

/* ---------- Stats Card ---------- */
.stats-card {
  background: linear-gradient(135deg, #1e293b, #0f172a);
  color: white;
  padding: 3rem;
  border-radius: 20px;
  margin: 3rem 0;
  text-align: center;
  clear: both;
}

.stats-number {
  font-size: 3.5rem;
  font-weight: 800;
  color: #3b82f6;
  margin-bottom: 0.5rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-top: 2rem;
}

/* ---------- Clearfix ---------- */
.clearfix::after {
  content: "";
  clear: both;
  display: table;
}

/* ---------- Loading Animation ---------- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.5s ease forwards;
}

/* ---------- Responsive Design ---------- */
@media (max-width: 768px) {
  .post-title {
    font-size: 1.8rem;
  }
  
  .post-content {
    padding: 1.5rem;
  }
  
  .image-grid-2,
  .image-grid-3,
  .two-column,
  .definition-box,
  .meter-types {
    grid-template-columns: 1fr;
  }
  
  .float-image-left,
  .float-image-right {
    float: none;
    width: 100%;
    margin: 1rem 0;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .feature-image {
    height: auto;
  }
  
  .post-meta {
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
  }
  
  .function-grid,
  .benefits-grid,
  .requirement-grid {
    grid-template-columns: 1fr;
  }
  
  .grid-item img {
    height: 180px;
  }
  
  .structure-box::before {
    font-size: 3rem;
  }
}

@media (max-width: 480px) {
  .blog-post-section {
    padding: 1rem;
  }
  
  .post-content {
    padding: 1rem;
  }
  
  .inspection-row {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .inspection-label {
    min-width: auto;
  }
  
  .share-section {
    flex-direction: column;
    text-align: center;
  }
}
/* ============================================
   COMMON JS COMPONENT STYLES
   ============================================ */

/* Table of Contents */
.toc {
  background: #f8fafc;
  padding: 1.5rem;
  border-radius: 16px;
  margin: 2rem 0;
  border-left: 4px solid #3b82f6;
}

.toc h4 {
  margin-top: 0;
  margin-bottom: 1rem;
  color: #1e293b;
}

.toc ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc li {
  margin-bottom: 0.5rem;
}

.toc a {
  color: #475569;
  text-decoration: none;
  transition: color 0.2s ease;
  display: inline-block;
}

.toc a:hover {
  color: #3b82f6;
  transform: translateX(5px);
}

.toc-h2 {
  margin-left: 0;
  font-weight: 600;
}

.toc-h3 {
  margin-left: 1.5rem;
  font-size: 0.95rem;
}

/* Reading Progress Bar */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 4px;
  background: linear-gradient(90deg, #3b82f6, #8b5cf6);
  width: 0%;
  z-index: 9999;
  transition: width 0.1s ease;
}

/* Back to Top Button */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  color: white;
  border: none;
  cursor: pointer;
  font-size: 20px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
  transition: all 0.3s ease;
  opacity: 0;
  visibility: hidden;
  z-index: 999;
}

.back-to-top:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.4);
}

/* Print styles */
@media print {
  .back-to-top,
  .share-section,
  .post-tags,
  .reading-progress,
  .copy-code-btn,
  .back-link {
    display: none !important;
  }
  
  .post-content {
    box-shadow: none;
    padding: 1rem;
  }
  
  a {
    text-decoration: none;
    color: black;
  }
}

/* Code blocks */
.code-block-wrapper {
  position: relative;
  margin: 1.5rem 0;
}

.copy-code-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #1e293b;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 4px 12px;
  font-size: 0.8rem;
  cursor: pointer;
  z-index: 10;
  transition: all 0.2s ease;
}

.copy-code-btn:hover {
  background: #3b82f6;
}

/* Lightbox */
.lightbox {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Sortable tables */
.sortable-table th {
  cursor: pointer;
  position: relative;
  padding-right: 20px;
}

.sortable-table th.sort-asc::after {
  content: ' ↑';
  position: absolute;
  right: 5px;
}

.sortable-table th.sort-desc::after {
  content: ' ↓';
  position: absolute;
  right: 5px;
}

/* Zoomable diagrams */
.zoomable-diagram {
  cursor: zoom-in;
  transition: transform 0.3s ease;
}

.zoomable-diagram.zoomed {
  transform: scale(1.5);
  cursor: zoom-out;
  z-index: 100;
  position: relative;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}
