/**
 * Article detail page: prose, TOC, mobile guestbook/sidebar tweaks.
 * Load only on templates that use .entry-content + #eyou-css (e.g. pc/view_article.htm).
 */

/* Bootstrap row flex children default min-width:auto — wide tables/pre expand main column and drop sidebar below */
.sigma_post-details.style-6 > .container > .row > .col-lg-8,
.sigma_post-details.style-6 > .container > .row > .col-lg-4 {
  min-width: 0;
}

/* Blog body readability */
.entry-content {
  color: #222;
  font-size: 1rem;
  line-height: 1.8;
  word-wrap: break-word;
  word-break: break-word;
  padding: 0.5rem;
  max-width: 100%;
  box-sizing: border-box;
}

.entry-content #eyou-css {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
}

.entry-content h1,
.entry-content h2,
.entry-content h3,
.entry-content h4,
.entry-content h5,
.entry-content h6 {
  color: #111;
  font-weight: 600;
  margin-top: 1.6em;
  margin-bottom: 0.6em;
  line-height: 1.25;
}

.entry-content p {
  margin: 0 0 1em 0;
  color: #333;
}

.entry-content img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1rem 0;
  border-radius: 4px;
}

.entry-content figure {
  margin: 1rem 0;
  text-align: center;
}

.entry-content figcaption {
  font-size: 0.9rem;
  color: #666;
  margin-top: 0.5rem;
}

.entry-content blockquote {
  border-left: 4px solid #e6e6e6;
  padding: 0.6rem 1rem;
  color: #555;
  background: #fafafa;
  margin: 1rem 0;
}

.entry-content pre {
  background: #2b2b2b;
  color: #f8f8f2;
  padding: 1rem;
  overflow: auto;
  max-width: 100%;
  box-sizing: border-box;
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, "Roboto Mono", monospace;
  font-size: 0.9rem;
  margin: 1rem 0;
}

.entry-content code {
  background: #f5f5f5;
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, "Roboto Mono", monospace;
  font-size: 0.95em;
}

.entry-content ul,
.entry-content ol {
  margin: 0 0 1rem 1.25rem;
  padding: 0;
}

.entry-content table,
.entry-content #eyou-css table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  table-layout: auto;
}

.entry-content table th,
.entry-content table td,
.entry-content #eyou-css table th,
.entry-content #eyou-css table td {
  border: 1px solid #e6e6e6;
  padding: 0.6rem;
  text-align: left;
}

.entry-content hr {
  border: 0;
  border-top: 1px solid #eee;
  margin: 2rem 0;
}

.entry-content a {
  color: #1e88e5;
  text-decoration: underline;
}

/* CMS/editor <strong> — was 800 and looked “randomly bold”; keep readable without shouting */
.entry-content strong,
.entry-content b {
  font-weight: 600;
}

.entry-content a:hover { color: #155fa0; }

/* Custom bullets: anchor to each list item (old left:25px overlapped text when ul padding differed) */
#eyou-css ul {
  padding-left: 1.25rem;
  margin: 0 0 1rem 0;
}

#eyou-css ul li {
  position: relative;
  list-style: none;
  padding-left: 0.35rem;
}

#eyou-css ul li::before {
  content: "•";
  position: absolute;
  left: -0.85rem;
  color: #333;
}

#eyou-css img {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  height: auto;
}

.entry-content #eyou-css iframe,
.entry-content #eyou-css embed,
.entry-content #eyou-css video {
  max-width: 100%;
}

.sigma_post-details-meta span {
  color: #777;
  margin-right: 1rem;
  display: inline-block;
}

.entry-title {
  margin: 0.4rem 0 1rem;
  font-weight: 700;
  color: #111;
}

.wzc-product-recommendation-box .featured-products-heading {
  font-size: 1.25rem !important;
  font-weight: 600;
  margin: 0 0 1rem;
  line-height: 1.3;
  color: #111;
}

@media (min-width: 1024px) {
  .entry-content { font-size: 1rem; }
  .entry-content h1 { font-size: 2.25rem; }
  .entry-content h2 { font-size: 1.75rem; }
  .entry-content h3 { font-size: 1.25rem; }
}

/* Table of contents */
.eyou-toc-container {
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  margin: 25px 0 35px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.eyou-toc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: #fafafa;
  border-bottom: 1px solid #e5e5e5;
  cursor: pointer;
  transition: background 0.2s;
  user-select: none;
}

.eyou-toc-header:hover {
  background: #f0f0f0;
}

.eyou-toc-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 600;
  color: #333;
}

.eyou-toc-icon {
  font-size: 18px;
}

.eyou-toc-toggle {
  font-size: 14px;
  color: #666;
  transition: transform 0.3s ease;
}

.eyou-toc-toggle.collapsed {
  transform: rotate(-90deg);
}

.eyou-toc-content {
  max-height: 2000px;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.3s ease;
  padding: 20px;
}

.eyou-toc-content.collapsed {
  max-height: 0;
  padding: 0 20px;
}

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

.eyou-toc-item {
  margin-bottom: 10px;
}

.eyou-toc-item a {
  color: #4a5568;
  text-decoration: none;
  font-size: 14px;
  line-height: 1.8;
  transition: all 0.2s;
  display: block;
  padding: 4px 0;
  border-radius: 4px;
}

.eyou-toc-item a:hover {
  color: #3498db;
  padding-left: 8px;
  background: #f8f9fa;
}

.eyou-toc-sub-item {
  margin-left: 20px;
  margin-top: 6px;
}

.eyou-toc-sub-item a {
  color: #718096;
  font-size: 13px;
}

@media (max-width: 768px) {
  .eyou-toc-container {
    margin: 15px 0 20px;
  }

  .eyou-toc-header {
    padding: 14px 16px;
  }

  .eyou-toc-title {
    font-size: 15px;
  }

  .eyou-toc-content {
    padding: 16px;
  }

  .article-wrapper {
    padding: 20px;
  }

  .section.sigma_post-details.style-6 > .container {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  .sigma_post-details-inner {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .entry-content {
    padding: 12px 0 !important;
  }

  #eyou-css table {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-collapse: collapse;
    margin: 14px 0;
  }

  #eyou-css table th,
  #eyou-css table td {
    white-space: nowrap;
    padding: 8px 10px;
    font-size: 13px;
    line-height: 1.25;
    vertical-align: top;
  }

  #eyou-css table th {
    font-weight: 600;
  }

  #eyou-css table img {
    max-width: 120px;
    height: auto;
  }

  .sigma_post-details-meta {
    margin: 12px 0 !important;
    padding: 12px 14px !important;
    border: 1px solid #eee !important;
    border-radius: 10px;
    background: #fff;
  }

  .sigma_post-details-meta a {
    word-break: break-word;
  }

  .comment-form .form-group {
    margin-bottom: 14px !important;
  }

  .comment-form .form-control,
  .comment-form select {
    width: 100%;
    max-width: 100%;
    height: auto !important;
    min-height: 44px;
    padding: 10px 12px !important;
    font-size: 14px !important;
    line-height: 1.35 !important;
    border-radius: 10px;
    box-sizing: border-box;
  }

  .comment-form select {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .comment-form select option {
    white-space: normal;
    word-break: break-word;
  }

  .comment-form textarea.form-control {
    min-height: 120px;
    resize: vertical;
  }

  .comment-form .sigma_btn-custom {
    display: inline-block;
    margin-top: 4px;
    padding: 10px 16px !important;
    min-height: 44px;
  }

  .whatsapp-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px !important;
    line-height: 1.4;
  }

  .sidebar {
    padding: 0 !important;
  }

  .sidebar .widget {
    border-radius: 12px;
  }

  .widget.widget-categories ul {
    margin: 0;
    padding-left: 0;
  }

  .widget.widget-categories li {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
  }

  .widget.widget-categories li:last-child {
    border-bottom: 0;
  }
}
