/* Link Card overrides */

/* Container */
.link-card {
  display: flex;
  border: 1px solid #e1e4e8;
  border-radius: 6px;
  overflow: hidden;
  width: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  margin: 1.5em 0;
}

/* Image — inline mode: 30% width, fixed height */
.link-card:not(.link-card-block) img.link-card-image {
  position: relative;
  width: 30%;
  min-width: 150px;
  max-width: 250px;
  height: 160px;
  flex-shrink: 0;
  border-right: 1px solid #e1e4e8;
  background-color: #f6f8fa;
  overflow: hidden;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* Reset global img styles from any page */
.link-card img.link-card-image {
  position: absolute;
  top: 0;
  left: 0;
  margin-left: 0;
  margin-top: 0;
  margin-right: 0;
  margin-bottom: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  min-width: 0;
  max-width: none;
  object-fit: cover;
  object-position: center;
  display: block;
  border: 0;
}

/* Content — z-index above image */
.link-card-content {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  flex: 1;
  position: relative;
  z-index: 1;
  background: #fff;
}

/* Title */
.link-card-title {
  font-size: 16px;
  font-weight: 600;
  color: #0366d6;
  text-decoration: none;
  margin: 0 0 6px;
  line-height: 1.3;
  position: relative;
  z-index: 2;
}

.link-card-title:hover {
  text-decoration: underline;
}

/* Description — reset global p styles */
.link-card p.link-card-description {
  font-size: 14px;
  color: #586069;
  margin: 0;
  padding: 0;
  line-height: 1.5;
  hyphens: none;
  -webkit-hyphens: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  position: relative;
  z-index: 2;
}

/* Block mode: full width, natural height */
.link-card-block {
  flex-direction: column;
}

.link-card-block img.link-card-image {
  position: relative;
  width: 100%;
  max-width: none;
  min-width: 0;
  height: auto;
  min-height: 200px;
  border-right: none;
  border-bottom: 1px solid #e1e4e8;
}

/* Dark mode */
[data-theme="dark"] .link-card {
  border-color: #30363d;
  background-color: #161b22;
}

[data-theme="dark"] .link-card:not(.link-card-block) img.link-card-image {
  border-right-color: #30363d;
}

[data-theme="dark"] img.link-card-image {
  background-color: #21262d;
  border-color: #30363d;
}

[data-theme="dark"] .link-card-content {
  background: #161b22;
}

[data-theme="dark"] .link-card-title {
  color: #58a6ff;
}

[data-theme="dark"] .link-card p.link-card-description {
  color: #8b949e;
}
