/**
 * WCRS Project Card V2 Widget Styles
 *
 * Horizontal project card v2 for Elementor Loop Grid.
 * Layout: image (left) + content (right) with rounded corners on entire card.
 * Design based on Figma: WCRS Projects V2 (node-id: 427-10131)
 */

/* Card wrapper - horizontal flexbox */
.wcrs-project-card-v2 {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  width: 100%;
  overflow: hidden;
  height: 100%;
  min-height: 179px;
}

/* Image section (left) */
.wcrs-project-card-v2-image {
  position: relative;
  height: auto;
  overflow: hidden;
  align-self: stretch;
}

.wcrs-project-card-v2-image-link {
  display: block;
  width: 100%;
  height: 100%;
  text-decoration: none;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

.wcrs-project-card-v2-image img,
.elementor .wcrs-project-card-v2-image img,
.elementor-widget-wcrs_project_card_v2 .wcrs-project-card-v2-image img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  object-position: center;
  display: block !important;
  transition: transform 0.3s ease;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  max-width: none !important;
}

.wcrs-project-card-v2-image-link:hover .wcrs-project-card-v2-image img {
  transform: scale(1.05);
}

/* Image placeholder (no featured image) */
.wcrs-project-card-v2-image-placeholder {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

/* Content section (right) */
.wcrs-project-card-v2-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  justify-content: flex-start;
  min-height: 0; /* Pozwala na prawidłowe działanie line-clamp w flexbox */
}

/* Title link */
a.wcrs-project-card-v2-title-link {
  all: unset;
  text-decoration: none;
  color: inherit !important;
}

.wcrs-project-card-v2-title-link:hover {
  opacity: 0.8;
}

/* Title */
.wcrs-project-card-v2-title {
  margin: 0;
  padding: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Excerpt */
.wcrs-project-card-v2-excerpt {
  margin: 0;
  padding: 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  text-overflow: ellipsis;
  word-break: break-word;
  min-height: 0;
}

/* Link */
.wcrs-project-card-v2-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  transition: opacity 0.2s ease;
  align-self: flex-start;
  margin-top: auto;
}

.wcrs-project-card-v2-link:not(:hover) {
  text-decoration: none;
}

.wcrs-project-card-v2-link:hover {
  opacity: 0.8;
}

.wcrs-project-card-v2-link-text {
  display: inline-block;
}

.wcrs-project-card-v2-link-icon {
  display: inline-flex;
  align-items: center;
  line-height: 1;
  font-size: 16px;
}

/* Button variant (WCRS Primary style based on presets) */
.wcrs-project-card-v2-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  align-self: flex-start;
  margin-top: auto;
  padding: 8px 12px 8px 16px;
  border-radius: 10px;
  background-color: var(--e-global-color-primary, #012d5b);
  color: #ffffff;
  font-family:
    "sofia-pro",
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  font-size: 16px;
  font-weight: 500;
  line-height: 24px;
  border: none;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    opacity 0.2s ease,
    transform 0.15s ease;
}

.wcrs-project-card-v2-button:hover {
  opacity: 0.9;
  text-decoration: none;
  transform: translateY(-1px);
}

.wcrs-project-card-v2-button:not(:hover) {
  text-decoration: none;
}

.wcrs-project-card-v2-button-text {
  display: inline-block;
}

.wcrs-project-card-v2-button-icon {
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

.wcrs-project-card-v2-button-icon svg {
  width: 24px;
  height: 24px;
}

/* Responsive - Mobile */
@media (max-width: 767px) {
  .wcrs-project-card-v2 {
    flex-direction: column;
  }

  .wcrs-project-card-v2-image {
    flex: 0 0 auto;
    width: 100%;
  }

  .wcrs-project-card-v2-content {
    flex: 0 0 auto;
    width: 100%;
  }
}

/* Accessibility - focus states */
.wcrs-project-card-v2-image-link:focus-visible,
.wcrs-project-card-v2-title-link:focus-visible,
.wcrs-project-card-v2-link:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
  border-radius: 2px;
}
