/* Learning Center Enhancements
   Scoped to .layout-blog pages only */

/* ── Reading Time ── */
.post-reading-time {
  display: inline-block;
  color: #666;
  font-size: 0.9em;
  margin-left: 0.5em;
}
.post-header .post-reading-time {
  margin-left: 0;
  display: block;
  margin-top: 0.25em;
  font-size: 0.85em;
  color: #888;
}
.post-preview .post-reading-time {
  display: block;
  margin-top: 0.4em;
  margin-left: 0;
  font-size: 0.85em;
  color: #999;
}

/* ── Table of Contents ── */
.post-content [id^="toc-"] {
  scroll-margin-top: 160px;
}
.post-toc {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-left: 4px solid #2f53a2;
  border-radius: 4px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
}
.post-toc-title {
  font-family: 'Teko', sans-serif;
  font-size: 1.4rem;
  font-weight: 500;
  color: #2f53a2;
  margin: 0 0 0.75rem 0;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.post-toc ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.post-toc > ul > li {
  margin-bottom: 0.4em;
}
.post-toc ul ul {
  padding-left: 1.25em;
  margin-top: 0.3em;
}
.post-toc ul ul li {
  margin-bottom: 0.3em;
}
.post-toc a {
  color: #323232;
  text-decoration: none;
  font-size: 0.95em;
  line-height: 1.5;
  transition: color 0.15s;
}
.post-toc a:hover {
  color: #2f53a2;
  text-decoration: underline;
}

/* ── Search ── */
.lc-search {
  position: relative;
  margin-bottom: 1.5rem;
}
input[type=text].lc-search-input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.75rem;
  font-size: 1rem;
  font-family: 'Titillium Web', sans-serif;
  border: 2px solid #ddd;
  border-radius: 6px;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 0.85rem center;
  background-size: 18px;
}
input[type=text].lc-search-input:focus {
  border-color: #2f53a2;
}
input[type=text].lc-search-input::placeholder {
  color: #aaa;
}
.lc-search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 100;
  background: #fff;
  border: 1px solid #ddd;
  border-top: none;
  border-radius: 0 0 6px 6px;
  max-height: 400px;
  overflow-y: auto;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.lc-search-result {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f0f0f0;
  text-decoration: none;
  color: #323232;
  transition: background 0.15s;
}
.lc-search-result:hover,
.lc-search-result.is-active {
  background: #f5f7ff;
}
.lc-search-result-img {
  width: 60px;
  height: 45px;
  object-fit: cover;
  border-radius: 3px;
  flex-shrink: 0;
}
.lc-search-result-body {
  flex: 1;
  min-width: 0;
}
.lc-search-result-title {
  font-weight: 600;
  font-size: 0.95em;
  margin-bottom: 0.15em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lc-search-result-tags {
  font-size: 0.8em;
  color: #ff6900;
}
.lc-search-no-results {
  padding: 1rem;
  text-align: center;
  color: #999;
  font-size: 0.95em;
}

/* ── Related Articles ── */
.post-related {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 2px solid #e9ecef;
}
.post-related h2 {
  font-family: 'Teko', sans-serif;
  font-size: 1.6rem;
  color: #2f53a2;
  text-transform: uppercase;
  margin-bottom: 1rem;
}
.post-related .row-xl > div {
  padding: 0 0.75rem;
}
.post-related .box {
  margin-bottom: 1rem;
}
.post-related .box img {
  width: 100%;
  height: auto;
  border-radius: 4px;
}
.post-related .box h3 {
  font-family: 'Titillium Web', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  text-transform: none;
  line-height: 1.4;
  margin: 0.75em 0 0.5em;
}
.post-related .box h3 a {
  color: #24539f;
  text-decoration: none;
}
.post-related .box h3 a:hover {
  color: #2f53a2;
  text-decoration: underline;
}
.post-related .box .post-tags {
  font-size: 0.8rem;
  line-height: 0.8rem;
  color: transparent;
  padding: 6px 0 0 0;
}
.post-related .box .post-tags a {
  background-color: #aaa;
  color: #fefefe;
  border-radius: 3px;
  padding: 5px 10px;
  margin: 0 3px 6px 0;
  display: inline-block;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
}
.post-related .box .post-tags a:hover {
  background-color: #73be44;
}

/* ── Weighted Tag Cloud ── */
#sidebar-tags .tags.is-weighted a {
  line-height: 1.8;
}

/* ── Collapsible Tags on Mobile ── */
.tags-toggle {
  display: none;
  margin-top: 0.5rem;
  padding: 0.4rem 0.8rem;
  font-size: 0.85em;
  font-family: 'Titillium Web', sans-serif;
  background: #f0f0f0;
  border: 1px solid #ddd;
  border-radius: 4px;
  color: #666;
  cursor: pointer;
  transition: background 0.15s;
}
.tags-toggle:hover {
  background: #e0e0e0;
}

@media (max-width: 767px) {
  .tags-toggle {
    display: inline-block;
  }
  #sidebar-tags .tags.is-collapsed a:nth-child(n+16) {
    display: none;
  }
}
