/* Common Symptoms Custom Layout */
.common-symptoms-layout {
  display: flex;
  justify-content: space-between;
  gap: 60px;
  margin-top: 20px;
}

.common-symptoms-main {
  flex: 1;
  min-width: 0; /* Prevents flex items from overflowing */
}

.common-symptoms-sidebar {
  width: 300px;
  flex-shrink: 0;
}

/* Sidebar Titles (Centered with lines - Image 2 style) */
.sidebar-title {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: bold;
  margin-bottom: 10px;
  border-bottom: none !important; /* Remove individual underline */
}

.sidebar-title::before,
.sidebar-title::after {
  content: "";
  flex: 1;
  height: 2px;
  background: #ccc;
}

.sidebar-title::before {
  margin-right: 40px;
}

.sidebar-title::after {
  margin-left: 40px;
}

/* Sidebar Lists (Arrows + Underlines - Image 2/4 style) */
.sidebar-widget ul {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 0 1em 0 !important;
}

.sidebar-widget ul li {
  padding: 15px 0;
  border-bottom: 1px solid #eee;
  display: block; /* Stack content vertically */
}

.sidebar-widget ul li a {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  text-decoration: none;
  transition: opacity 0.3s;
  font-size: 1.4rem; /* Adjusted for better balance */
}

.sidebar-widget ul li a::before {
  content: "";
  display: block;
  width: 10px;
  height: 10px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='9 18 15 12 9 6'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: contain;
  margin-top: 4px;
  flex-shrink: 0;
}

/* Post Layouts (Recent & Popular - Vertical style) */
.sidebar-widget.widget_popular_posts ul li,
.sidebar-widget.widget_recent_entries ul li {
  border-bottom: none;
  padding-bottom: 30px;
}

.sidebar-widget.widget_popular_posts ul li a,
.sidebar-widget.widget_recent_entries ul li a {
  flex-direction: column;
  gap: 15px;
}

.sidebar-widget.widget_popular_posts ul li a::before,
.sidebar-widget.widget_recent_entries ul li a::before {
  content: none; /* No arrows for post images */
}

.ranking-thumb-wrapper,
.recent-thumb {
  width: 100%;
  position: relative;
  overflow: hidden;
}

.ranking-thumb-wrapper img,
.recent-thumb img {
  width: 100% !important;
  height: auto !important;
  display: block;
  margin-bottom: 10px;
}

/* Ranking Badges */
.ranking-list {
  counter-reset: wpp-ranking;
}

.ranking-thumb-wrapper::after {
  counter-increment: wpp-ranking;
  content: counter(wpp-ranking);
  position: absolute;
  top: 0;
  left: 0;
  background: #ff8c00; /* Orange badge */
  color: #fff;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.2rem;
  z-index: 10;
}

.wpp-post-title,
.recent-title {
  font-weight: bold;
  line-height: 1.4;
  color: #333;
}

/* TOC Styling (LuckyWP - Modern Reference Style) */
.lwptoc {
  background: #fdfdfd !important;
  border: none !important;
  padding: 30px !important;
  margin: 40px 0 !important;
  width: 100% !important;
  font-family: inherit !important;
  box-shadow: 0 2px 15px rgba(0,0,0,0.03);
  border-radius: 8px;
}

/* Header style with "三 目次" */
.lwptoc_header {
  display: flex !important;
  align-items: center;
  justify-content: center;
  margin-bottom: 30px !important;
  font-size: 2rem !important;
  font-weight: bold !important;
  color: #333 !important;
}

.lwptoc_header::before {
  content: "\2261"; /* Three-line/Hamburger icon */
  margin-right: 15px;
  font-size: 1.2em;
  color: #666;
  font-weight: normal;
}

/* .lwptoc_title {
  display: none !important;
} */


.lwptoc_items {
  padding-left: 0 !important;
  list-style: none !important;
}

.lwptoc_item {
  padding: 5px 0 !important;
  margin: 0 !important;
  font-size: 1.5rem !important;
}

.lwptoc_item a {
  display: flex !important;
  align-items: flex-start !important;
  color: #333 !important;
  text-decoration: none !important;
  line-height: 1.6 !important;
  transition: color 0.2s;
}

.lwptoc_item a:hover {
  color: #4b8da3;
  text-decoration: none !important;
  border: none !important;
  opacity: 0.7;
}

.lwptoc_item_label {
  display: flex !important;
  align-items: flex-start !important;
  gap: 10px !important;
}

/* Vertical Bar Separator after numbering */
.lwptoc_item_number {
  color: #4b8da3; /* Theme color */
  font-weight: bold;
  opacity: 0.8;
}

.lwptoc_item_number::after {
  content: "|";
  color: #ccc;
  margin: 0 12px;
  font-weight: normal;
}

/* Nesting support for LuckyWP TOC (Adjusted spacing) */
.lwptoc_items_2 {
  padding-left: 2em !important;
  margin-top: 5px !important;
}

.lwptoc_items_2 .lwptoc_item {
  padding: 8px 0 !important;
  font-size: 1.4rem !important;
}


/* Ensure all parents have overflow: visible for sticky to work */
.l-wrapper,
.l-main,
.l-main__inner,
.c-inner,
.common-symptoms-layout,
.l-section {
  overflow: visible !important;
}

.common-symptoms-sidebar {
  /* height: auto !important; // Removed to allow alignment: stretch and sticky child tracking */
  display: flex !important;
  flex-direction: column !important;
}

.common-symptoms-sidebar .widget_toc {
  position: -webkit-sticky !important;
  position: sticky !important;
  top: 150px !important;
  z-index: 100;
  margin-top: 15px; /* Push to bottom if needed, but allow stickiness */
  align-self: flex-start;
}

.common-symptoms-sidebar .lwptoc {
  background: none !important;
  padding: 0 !important;
  margin: 0 !important;
  box-shadow: none !important;
}

.common-symptoms-sidebar .lwptoc_header {
  display: none !important;
}

.common-symptoms-sidebar .lwptoc_item {
  border-bottom: none !important; /* Remove line as requested */
  padding: 5px 0 !important;
}

/* Responsive */
@media (max-width: 1024px) {
  .common-symptoms-layout {
    flex-direction: column;
    gap: 40px;
  }

  .common-symptoms-sidebar {
    width: 100%;
  }

  /* Tablet Layout for Posts (3 items per row) */
  .sidebar-widget.widget_popular_posts ul,
  .sidebar-widget.widget_recent_entries ul {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 0 !important; /* Reset gap to use padding for gutters */
    margin: 0 -10px !important; /* Negative margin to offset li padding */
  }

  .sidebar-widget.widget_popular_posts ul li,
  .sidebar-widget.widget_recent_entries ul li {
    width: 33.333% !important;
    box-sizing: border-box !important;
    padding: 0 10px 30px 10px !important; /* Use padding for gutter instead of gap if layout is tight */
    border-bottom: none !important;
  }

  .sidebar-widget.widget_popular_posts ul li a,
  .sidebar-widget.widget_recent_entries ul li a {
    flex-direction: column !important; /* Keep vertical form */
    align-items: flex-start !important;
    gap: 15px !important;
  }

  .ranking-thumb-wrapper,
  .recent-thumb {
    width: 100% !important;
    flex: none !important;
  }
}

.lwptoc_i{
  width: 100%;
}
.lwptoc-notInherit .lwptoc_i DIV A:hover {
    border-bottom: 0 !important
}
.lwptoc-baseItems{
  background-color: #f5f5f5 !important;
  border: 1px solid #ccc;
  border-radius: 10px;
}

.sidebar-widget.widget_toc{
  width: 100% !important;
}

.sidebar-widget{
  margin-bottom: 30px;
}