/**
 * Custom sidebar widgets for single blog posts only (author box + Table of Contents)
 * See: sidebar.php, functions/functions-content-generation.php, js/single-post-toc.js
 * Kept in its own file so it's a single, self-contained thing to port to another environment.
 */

/* "Free Injury Case Evaluation" form - same card frame as the Table Of Contents / Main
   Practice Areas / Categories accordions, so it doesn't look bare sitting next to them */
.contact-sidebar {
  background: #fff;
  padding: 18px;
  border: 1px solid rgba(225, 225, 225, 1);
  box-shadow: rgba(0, 0, 0, 0.15) 1.95px 1.95px 2.6px;
}

/* "About the author" card under the article body */
.post-author-box {
  background: #14172f;
  border-radius: 24px;
  padding: 32px;
  margin: 40px 0 !important;
}
.post-author-box-top {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
}
.post-author-box-photo {
  flex: 0 0 auto;
  width: 90px;
  height: 90px;
  border-radius: 16px;
  overflow: hidden;
  background: #cc9a48;
}
.post-author-box-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.post-author-box-heading {
  flex: 1 1 auto;
  min-width: 0;
}
.post-author-box-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: #cc9a48;
  margin-bottom: 4px;
}
.post-author-box-name {
  font-size: 26px;
  line-height: 1.2;
  color: #fff;
  margin: 0;
}
.post-author-box-text {
  font-size: 16px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.85);
  margin: 0 0 20px 0;
}
.post-author-box-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;

  color: #cc9a48;
  text-decoration: none;
}
.post-author-box-link i {
  font-size: 13px;
  transition: transform 0.3s ease;
}
.post-author-box-link:hover {
  color: #e0b060;
  text-decoration: none;
}
.post-author-box-link:hover i {
  transform: translateX(4px);
}
/* Hovering the "Read More" link/button also scales the photo, per request */
.post-author-box:has(.post-author-box-link:hover) .post-author-box-photo img {
  transform: scale(1.08);
}

@media screen and (max-width: 640px) {
  .post-author-box {
    padding: 24px;
  }
  .post-author-box-photo {
    width: 72px;
    height: 72px;
  }
  .post-author-box-name {
    font-size: 22px;
  }
}

/* Table of Contents accordion */
.sidebar-toc {
  background: #fff !important;
  padding: 18px !important;
  border: 1px solid rgba(225, 225, 225, 1) !important;
  box-shadow: rgba(0, 0, 0, 0.15) 1.95px 1.95px 2.6px !important;
}
section.sidebar-block.sidebar-toc button.sidebar-toc-toggle {
  margin: 0;
}
/* Overrides the sitewide button/.button reset (css/critical.css), which otherwise wins on
   :hover/:focus due to higher specificity and paints this toggle as a red CTA pill */
.sidebar-toc-toggle,
.sidebar-toc-toggle:hover,
.sidebar-toc-toggle:focus {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: none;
  background-color: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  text-align: left;
  text-transform: none;
  letter-spacing: normal;
  font-family: inherit;
}
.sidebar-toc-toggle-title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.15;
  color: #123947;
}
.sidebar-toc-toggle-icon {
  flex: 0 0 auto;
  margin-left: 16px;
  color: #1b1b1b;
  font-size: 20px;
  transition: transform 0.35s ease;
}
.sidebar-toc.open .sidebar-toc-toggle-icon {
  transform: rotate(180deg);
}
.sidebar-toc-panel {
  border-top: 1px solid transparent;
  height: 0;
  margin-top: 0;
  opacity: 0;
  overflow: hidden;
  padding-top: 0;
  transition:
    height 0.45s ease,
    margin-top 0.35s ease,
    opacity 0.25s ease,
    padding-top 0.35s ease,
    border-color 0.35s ease;
}
.sidebar-toc.open .sidebar-toc-panel {
  border-top: 1px solid #c9c9c9;
  height: var(--sidebar-toc-panel-height, auto);
  margin-top: 18px;
  opacity: 1;
  padding-top: 18px;
}
/* !important below overrides the sitewide ".sidebar section ul li" / "...ul li a" rules
   (style.css) that otherwise add a red chevron bullet, extra left padding, and force
   text-decoration:none + background:transparent!important on every sidebar list link */
.sidebar-toc-panel ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.sidebar-toc-item {
  padding: 0 !important;
  margin: 0 0 10px 0 !important;
  border-bottom: none !important;
}
.sidebar-toc-item:last-child {
  margin-bottom: 0 !important;
}
.sidebar-toc-item::before {
  content: none !important;
}
.sidebar-toc-item a {
  display: inline-block !important;
  padding: 0 !important;
  font-size: 14px !important;
  font-weight: 400 !important;
  line-height: 1.35 !important;
  color: #3f3f3f !important;
  text-decoration: underline !important;
  background: none !important;
}
.sidebar-toc-item a:hover {
  color: #123947 !important;
}
.sidebar-toc-item.sidebar-toc-level-3 a {
  margin-left: 16px;
  font-weight: 400 !important;
  font-size: 16px !important;
}

@media screen and (max-width: 1023px) {
  .sidebar-toc {
    padding: 32px 38px;
  }

  .sidebar-toc-toggle-title {
    font-size: 18px;
  }

  .sidebar-toc-toggle-icon {
    font-size: 20px;
  }

  .sidebar-toc-item a {
    font-size: 14px !important;
  }

  .sidebar-toc-item.sidebar-toc-level-3 a {
    font-size: 13px !important;
  }
}

@media screen and (max-width: 640px) {
  .sidebar-toc {
    padding: 28px 24px;
  }

  .sidebar-toc-toggle-title {
    font-size: 21px;
  }

  .sidebar-toc-item {
    margin-bottom: 20px !important;
  }

  .sidebar-toc-item a {
    font-size: 16px !important;
  }

  .sidebar-toc-item.sidebar-toc-level-3 a {
    font-size: 15px !important;
  }
}

/* Mobile: Table Of Contents moves above the article; everything else
   (search, Main Practice Areas, Categories, the form) stays at the bottom as-is.
   767px matches this theme's own stacked/columns breakpoint (see style.css). */
.mobile-top-widgets {
  display: none;
}

@media screen and (max-width: 767px) {
  .content.columns {
    display: flex;
    flex-direction: column;
  }

  .mobile-top-widgets {
    display: block;
    order: -1;
    margin-bottom: 24px;
  }

  /* The sidebar keeps its own TOC for desktop; on mobile the duplicate
     above the article takes over, so hide the sidebar's copy here */
  .sidebar-inner
    > .sidebar-toc:not(.sidebar-practice-areas):not(
      .sidebar-categories-accordion
    ) {
    display: none;
  }
}