/**
 * THE CONNECTED HAVEN - SIDEBAR WIDGETS STYLES
 *
 * Styles for custom sidebar widgets
 *
 * @package Blocksy_Child_TCH
 * @version 1.0.0
 */

/* ==========================================================================
   BASE SIDEBAR WIDGET
   ========================================================================== */

.tch-sidebar-widget {
  background: var(--tch-white);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  margin-bottom: var(--space-xl);
  border: 1px solid var(--tch-light);
}

.tch-sidebar-widget__title {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--tch-dark);
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-md);
  border-bottom: 2px solid var(--tch-light);
}

.tch-sidebar-widget__title svg {
  color: var(--tch-primary);
}

/* ==========================================================================
   NEWSLETTER WIDGET
   ========================================================================== */

.tch-sidebar-newsletter {
  background: linear-gradient(135deg, var(--tch-primary) 0%, var(--tch-primary-dark) 100%);
  border: none;
  color: var(--tch-white);
}

.tch-sidebar-newsletter__inner {
  text-align: center;
}

.tch-sidebar-newsletter__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-lg);
  margin: 0 auto var(--space-lg);
}

.tch-sidebar-newsletter__icon svg {
  color: var(--tch-white);
}

.tch-sidebar-newsletter__title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: var(--space-sm);
}

.tch-sidebar-newsletter__desc {
  font-size: 0.9375rem;
  opacity: 0.9;
  margin-bottom: var(--space-lg);
  line-height: 1.5;
}

.tch-sidebar-newsletter__form {
  margin-bottom: var(--space-md);
}

.tch-sidebar-newsletter__field {
  margin-bottom: var(--space-md);
}

.tch-sidebar-newsletter__input {
  width: 100%;
  padding: var(--space-md);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.1);
  color: var(--tch-white);
  font-size: 1rem;
  text-align: center;
}

.tch-sidebar-newsletter__input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.tch-sidebar-newsletter__input:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.15);
}

.tch-sidebar-newsletter .tch-btn {
  background: var(--tch-white);
  color: var(--tch-primary);
}

.tch-sidebar-newsletter .tch-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.tch-sidebar-newsletter__privacy {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  font-size: 0.75rem;
  opacity: 0.7;
}

/* ==========================================================================
   POPULAR POSTS WIDGET
   ========================================================================== */

.tch-sidebar-popular__list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.tch-sidebar-popular__item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--tch-light);
}

.tch-sidebar-popular__item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.tch-sidebar-popular__item:first-child {
  padding-top: 0;
}

.tch-sidebar-popular__number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--tch-light);
  border-radius: var(--radius-md);
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--tch-primary);
  flex-shrink: 0;
}

.tch-sidebar-popular__item:nth-child(1) .tch-sidebar-popular__number {
  background: var(--tch-primary);
  color: var(--tch-white);
}

.tch-sidebar-popular__item:nth-child(2) .tch-sidebar-popular__number {
  background: rgba(37, 99, 235, 0.2);
}

.tch-sidebar-popular__item:nth-child(3) .tch-sidebar-popular__number {
  background: rgba(37, 99, 235, 0.1);
}

.tch-sidebar-popular__content {
  flex: 1;
  min-width: 0;
}

.tch-sidebar-popular__link {
  display: block;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--tch-dark);
  text-decoration: none;
  line-height: 1.4;
  transition: color var(--transition-base);
}

.tch-sidebar-popular__link:hover {
  color: var(--tch-primary);
}

.tch-sidebar-popular__meta {
  font-size: 0.75rem;
  color: var(--tch-muted);
  margin-top: var(--space-xs);
}

/* ==========================================================================
   ECOSYSTEMS WIDGET
   ========================================================================== */

.tch-sidebar-ecosystems__list {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-lg);
}

.tch-sidebar-ecosystems__item {
  margin-bottom: var(--space-xs);
}

.tch-sidebar-ecosystems__link {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--tch-text);
  transition: all var(--transition-base);
}

.tch-sidebar-ecosystems__link:hover {
  background: var(--tch-light);
  color: var(--eco-color, var(--tch-primary));
}

.tch-sidebar-ecosystems__icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.tch-sidebar-ecosystems__name {
  flex: 1;
  font-weight: 500;
  font-size: 0.9375rem;
}

.tch-sidebar-ecosystems__arrow {
  opacity: 0;
  transform: translateX(-4px);
  transition: all var(--transition-base);
  color: var(--eco-color, var(--tch-primary));
}

.tch-sidebar-ecosystems__link:hover .tch-sidebar-ecosystems__arrow {
  opacity: 1;
  transform: translateX(0);
}

.tch-sidebar-ecosystems__quiz {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md);
  background: var(--tch-light);
  border-radius: var(--radius-md);
  color: var(--tch-primary);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition-base);
}

.tch-sidebar-ecosystems__quiz:hover {
  background: var(--tch-primary);
  color: var(--tch-white);
}

/* ==========================================================================
   SOCIAL SHARE BUTTONS
   ========================================================================== */

.tch-social-share {
  margin: var(--space-xl) 0;
}

.tch-social-share__label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--tch-muted);
  margin-bottom: var(--space-md);
}

.tch-social-share__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.tch-social-share__btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all var(--transition-base);
}

.tch-social-share__btn--twitter {
  background: #000;
  color: #fff;
}

.tch-social-share__btn--facebook {
  background: #1877f2;
  color: #fff;
}

.tch-social-share__btn--linkedin {
  background: #0a66c2;
  color: #fff;
}

.tch-social-share__btn--pinterest {
  background: #e60023;
  color: #fff;
}

.tch-social-share__btn--email {
  background: var(--tch-dark);
  color: #fff;
}

.tch-social-share__btn--copy {
  background: var(--tch-light);
  color: var(--tch-text);
}

.tch-social-share__btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.tch-social-share__btn--copy.is-copied {
  background: var(--tch-accent);
  color: #fff;
}

/* Vertical layout */
.tch-social-share--vertical {
  position: sticky;
  top: 100px;
}

.tch-social-share--vertical .tch-social-share__buttons {
  flex-direction: column;
}

.tch-social-share--vertical .tch-social-share__btn {
  justify-content: center;
  padding: var(--space-md);
}

.tch-social-share--vertical .tch-social-share__text {
  display: none;
}

/* ==========================================================================
   AUTHOR BOX
   ========================================================================== */

.tch-author-box {
  background: var(--tch-lighter);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  margin: var(--space-2xl) 0;
}

.tch-author-box__inner {
  display: flex;
  gap: var(--space-xl);
}

.tch-author-box__avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.tch-author-box__avatar {
  width: 100px;
  height: 100px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 4px solid var(--tch-white);
  box-shadow: var(--shadow-md);
}

.tch-author-box__badge {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 28px;
  height: 28px;
  background: var(--tch-accent);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--tch-white);
  border: 3px solid var(--tch-lighter);
}

.tch-author-box__content {
  flex: 1;
}

.tch-author-box__label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--tch-muted);
  margin-bottom: var(--space-xs);
}

.tch-author-box__name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: var(--space-sm);
}

.tch-author-box__name a {
  color: var(--tch-dark);
  text-decoration: none;
}

.tch-author-box__name a:hover {
  color: var(--tch-primary);
}

.tch-author-box__bio {
  font-size: 0.9375rem;
  color: var(--tch-text);
  line-height: 1.6;
  margin-bottom: var(--space-md);
}

.tch-author-box__meta {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  margin-bottom: var(--space-md);
}

.tch-author-box__posts,
.tch-author-box__social {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 0.8125rem;
  color: var(--tch-muted);
}

.tch-author-box__social {
  text-decoration: none;
}

.tch-author-box__social:hover {
  color: var(--tch-primary);
}

.tch-author-box__link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--tch-primary);
  text-decoration: none;
}

.tch-author-box__link:hover {
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 640px) {
  .tch-author-box__inner {
    flex-direction: column;
    text-align: center;
  }

  .tch-author-box__avatar-wrap {
    margin: 0 auto;
  }

  .tch-author-box__meta {
    justify-content: center;
  }

  .tch-author-box__link {
    justify-content: center;
  }
}

/* ==========================================================================
   RELATED POSTS
   ========================================================================== */

.tch-related-posts {
  margin: var(--space-3xl) 0;
  padding-top: var(--space-2xl);
  border-top: 1px solid var(--tch-light);
}

.tch-related-posts__header {
  margin-bottom: var(--space-xl);
}

.tch-related-posts__title {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--tch-dark);
  margin-bottom: var(--space-xs);
}

.tch-related-posts__title svg {
  color: var(--tch-primary);
}

.tch-related-posts__subtitle {
  color: var(--tch-muted);
  font-size: 1rem;
}

.tch-related-posts__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
}

@media (max-width: 1024px) {
  .tch-related-posts__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .tch-related-posts__grid {
    grid-template-columns: 1fr;
  }
}

.tch-related-post {
  background: var(--tch-white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--tch-light);
  transition: all var(--transition-base);
}

.tch-related-post:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}

.tch-related-post__link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.tch-related-post__image {
  position: relative;
  aspect-ratio: 16/10;
  overflow: hidden;
}

.tch-related-post__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-base);
}

.tch-related-post:hover .tch-related-post__image img {
  transform: scale(1.05);
}

.tch-related-post__category {
  position: absolute;
  top: var(--space-md);
  left: var(--space-md);
  padding: var(--space-xs) var(--space-sm);
  background: var(--tch-primary);
  color: var(--tch-white);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: var(--radius-sm);
}

.tch-related-post__content {
  padding: var(--space-lg);
}

.tch-related-post__title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--tch-dark);
  line-height: 1.4;
  margin-bottom: var(--space-sm);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tch-related-post__meta {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  font-size: 0.75rem;
  color: var(--tch-muted);
}

.tch-related-post__date,
.tch-related-post__read-time {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}
