/*
Theme Name: Divi Child Theme for SDGs
Template: Divi
Version: 2.0.0
Description: Enhanced child theme with merged plugin functionality for SDG and Category display.
*/

/* --- SDG Box & General Styles --- */
.sdgs-container {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  margin: 20px 0;
  gap: 10px;
  font-size: 16px;
}

.sdgs-label {
  font-weight: bold;
  margin-right: 10px;
  color: #333;
}

.sdg-box {
  color: white;
  border-radius: 6px;
  width: 36px;
  height: 36px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  font-weight: bold;
  font-size: 15px;
  line-height: 1;
  box-sizing: border-box;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  position: relative;
}

.sdg-box:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Sizes for SDG Boxes (from shortcode attribute) */
.sdg-box.sdg-box-small {
    width: 30px;
    height: 30px;
    font-size: 13px;
}
.sdg-box.sdg-box-large {
    width: 44px;
    height: 44px;
    font-size: 18px;
}

.sdgs-meta {
  margin: 15px 0;
  font-size: 0.95em;
  color: #333;
  padding: 10px;
  background-color: #f9f9f9;
  border-radius: 6px;
}

/* --- SDG Colors --- */
.sdg-1 { background-color: #e5243b; }
.sdg-2 { background-color: #dda63a; }
.sdg-3 { background-color: #4c9f38; }
.sdg-4 { background-color: #c5192d; }
.sdg-5 { background-color: #ff3a21; }
.sdg-6 { background-color: #26bde2; }
.sdg-7 { background-color: #fcc30b; }
.sdg-8 { background-color: #a21942; }
.sdg-9 { background-color: #fd6925; }
.sdg-10 { background-color: #dd1367; }
.sdg-11 { background-color: #fd9d24; }
.sdg-12 { background-color: #bf8b2e; }
.sdg-13 { background-color: #3f7e44; }
.sdg-14 { background-color: #0a97d9; }
.sdg-15 { background-color: #59c24a; }
.sdg-16 { background-color: #00689d; }
.sdg-17 { background-color: #19486a; }

/* --- SDG Tooltip Styles --- */
.sdg-tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background-color: #333;
  color: white;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 100;
  margin-bottom: 5px;
  pointer-events: none;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.sdg-box:hover .sdg-tooltip {
  opacity: 1;
  visibility: visible;
}

/* --- Strategy Category Styles (MERGED FROM PLUGIN) - v2 --- */
/* This block styles the container for flex-wrapping on single posts */
.category-vertical-list {
    display: flex;
    flex-wrap: wrap;
    flex-direction: row;
    gap: 0 15px;
    margin: 4px 0;
}

/* This is the MAIN style rule for ANY styled category link */
/* It applies to links in the vertical list AND links in the blog grid */
a.category-link {
    font-weight: 500 !important;
    text-decoration: none !important;
    padding: 2px 0;
    display: inline-flex;
    align-items: center;
    transition: all 0.2s ease;
    border-bottom: 1px solid transparent;
}

/* We don't need the old complex selectors anymore */
/* .category-vertical-list a.category-link { ... } */

.category-icon {
    margin-right: 6px;
    font-size: 0.9em;
}

/* Strategy Colors (from plugin) */
.strategy-color-green { color: #28a745 !important; }
.strategy-color-blue { color: #007bff !important; }
.strategy-color-gold { color: #d4af37 !important; }
.strategy-color-orange { color: #fd7e14 !important; }
.strategy-color-purple { color: #6f42c1 !important; }

/* Hover effects for Strategy Colors */
a.strategy-color-green:hover { border-bottom-color: #28a745; opacity: 0.8; }
a.strategy-color-blue:hover { border-bottom-color: #007bff; opacity: 0.8; }
a.strategy-color-gold:hover { border-bottom-color: #d4af37; opacity: 0.8; }
a.strategy-color-orange:hover { border-bottom-color: #fd7e14; opacity: 0.8; }
a.strategy-color-purple:hover { border-bottom-color: #6f42c1; opacity: 0.8; }



/* --- Other Component Styles --- */
/* (SDG Filter, Stats, Related Posts, Responsive, Print styles from your original file) */
/* For brevity, copy the rest of the CSS from your original style.css file here */
.sdg-filter-widget { /*...*/ }
.sdg-stats-dashboard { /*...*/ }
.related-sdg-posts { /*...*/ }
@media (max-width: 767px) { /*...*/ }
@media print { /*...*/ }

/* --- SDG Boxes in Blog Grid --- */
.blog-grid-sdgs {
    margin-top: 20px;      /* ระยะห่างจากส่วน meta หรือ read more */
    margin-bottom: 10px;   /* เพิ่มระยะห่างด้านล่างเล็กน้อย */
    clear: both;           /* ป้องกันการลอยของ element ข้างเคียง */
}

/* Override styles of the sdgs-container specifically for the blog grid */
.blog-grid-sdgs .sdgs-container {
    margin: 0;
    justify-content: flex-start;
    gap: 8px;
}

.blog-grid-sdgs .sdgs-label {
    font-weight: normal;
    font-size: 14px;
    color: #666;
}