// =============================================================================
// Sidebar Widgets
// =============================================================================

.widget {
  gap: 1.5rem;

  & > div {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-xs);
  }

  h4 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1rem;
    color: var(--text);
    text-decoration: none;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--primary);
    display: inline-block;
  }

  .btn-font {
    @include btn-font;
  }

  // Subscribe widget — gradient accent
  .widget_register {
    background: var(--gradient-primary);
    color: var(--white);
    border: none;
    border-radius: var(--radius, 0.75rem);

    h4 {
      color: var(--white);
      border-bottom-color: rgba(255, 255, 255, 0.3);
    }

    p {
      opacity: 0.9;
    }

    .form-control {
      background: rgba(255, 255, 255, 0.15);
      border: 1px solid rgba(255, 255, 255, 0.3);
      color: var(--white);
      border-radius: var(--radius, 0.375rem);

      &::placeholder {
        color: rgba(255, 255, 255, 0.6);
      }

      &:focus {
        background: rgba(255, 255, 255, 0.25);
        border-color: rgba(255, 255, 255, 0.6);
        color: var(--white);
        box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.15);
      }
    }

    .form-check-label {
      color: rgba(255, 255, 255, 0.9);
      font-size: 0.875rem;
    }

    .form-check-input {
      background-color: rgba(255, 255, 255, 0.2);
      border-color: rgba(255, 255, 255, 0.4);

      &:checked {
        background-color: var(--white);
        border-color: var(--white);
      }
    }

    .btn {
      background: var(--white);
      color: var(--primary);
      border: none;
      font-weight: 600;

      &:hover {
        box-shadow: var(--shadow-md);
        transform: translateY(-1px);
      }
    }
  }

  // Category links
  .widget_link {
    font-family: var(--font-body);
    color: var(--text);
    font-size: 0.9375rem;
    text-decoration: none;
    padding: 0.375rem 0;
    display: block;
    border-bottom: 1px solid var(--surface-alt);
    transition: color var(--transition-fast), padding-left var(--transition-fast);

    &:hover {
      color: var(--primary);
      padding-left: 0.5rem;
    }

    &:last-child {
      border-bottom: none;
    }
  }

}

// Last article widget — card verticale
.widget_article {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xs);

  h4 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1rem;
    color: var(--text);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--primary);
    display: inline-block;
  }

  &__link {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;

    &:hover {
      color: inherit;

      .widget_article__img img {
        transform: scale(1.05);
      }

      .widget_article__title {
        color: var(--primary);
      }
    }
  }

  &__img {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: var(--radius-md);

    img {
      max-width: 100%;
      width: 100%;
      height: 100%;
      object-fit: cover;
      transition: transform var(--transition-base);
    }
  }

  &__body {
    padding-top: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }

  &__title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1rem;
    color: var(--text);
    margin: 0;
    line-height: 1.4;
    transition: color var(--transition-fast);
  }

  &__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
  }

  &__cat {
    color: var(--primary);
    font-weight: 600;
  }

  &__date {
    color: var(--text-muted);
  }

  &__excerpt {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
}
