/* ox-content OGP Card Plugin - Link card styles */

.ox-ogp-card {
  display: flex;
  margin: 1.5rem 0;
  border: 0;
  border-top: 1px solid color-mix(in srgb, var(--octc-color-border) 74%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--octc-color-border) 74%, transparent);
  border-radius: 0;
  overflow: visible;
  background: transparent;
  text-decoration: none;
  color: var(--octc-color-text);
  transition: color 0.2s ease;
}

.ox-ogp-card:hover {
  text-decoration: none;
}

.ox-ogp-content {
  flex: 1;
  padding: 1rem 1.25rem;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.ox-ogp-title {
  font-weight: 600;
  font-size: 1rem;
  color: var(--octc-color-text);
  margin-bottom: 0.375rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ox-ogp-card:hover .ox-ogp-title {
  color: var(--octc-color-primary);
}

.ox-ogp-description {
  font-size: 0.8125rem;
  color: var(--octc-color-text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.ox-ogp-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--octc-color-text-muted);
}

.ox-ogp-favicon {
  width: 16px;
  height: 16px;
  border-radius: 2px;
}

.ox-ogp-domain {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ox-ogp-image {
  width: 200px;
  min-width: 200px;
  height: auto;
  object-fit: cover;
  background: var(--octc-color-bg-alt);
}

/* Compact variant (no image) */
.ox-ogp-card.compact {
  flex-direction: column;
}

.ox-ogp-card.compact .ox-ogp-image {
  width: 100%;
  min-width: 100%;
  height: 140px;
}

/* Vertical variant */
.ox-ogp-card.vertical {
  flex-direction: column;
}

.ox-ogp-card.vertical .ox-ogp-image {
  width: 100%;
  min-width: 100%;
  height: 180px;
}

/* Responsive */
@media (max-width: 640px) {
  .ox-ogp-card {
    flex-direction: column;
  }

  .ox-ogp-image {
    width: 100%;
    min-width: 100%;
    height: 160px;
    order: -1;
  }

  .ox-ogp-content {
    padding: 0.875rem 1rem;
  }
}

/* Loading state */
.ox-ogp-card.loading {
  min-height: 100px;
  justify-content: center;
  align-items: center;
}

.ox-ogp-card.loading::after {
  content: "";
  width: 24px;
  height: 24px;
  border: 2px solid var(--octc-color-border);
  border-top-color: var(--octc-color-primary);
  border-radius: 50%;
  animation: ox-ogp-spin 0.8s linear infinite;
}

@keyframes ox-ogp-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Error/fallback state */
.ox-ogp-card.error {
  border-color: var(--octc-color-border);
}

.ox-ogp-card.error .ox-ogp-content {
  width: 100%;
}

/* Simple link fallback */
.ox-ogp-simple {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0;
  border: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--octc-color-border) 74%, transparent);
  border-radius: 0;
  font-size: 0.875rem;
  color: var(--octc-color-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.ox-ogp-simple:hover {
  text-decoration: underline;
}

.ox-ogp-simple svg {
  width: 14px;
  height: 14px;
  color: var(--octc-color-text-muted);
}
