/**
 * WordPress oEmbed card — "Edhe" related article layout (embed iframe).
 *
 * @package KohaJone
 */

:root {
  --text-primary: #000;
  --color-blue: #4063db;
  --primaryFont: "Public Sans", sans-serif;
  --monoFont: "Space Mono", ui-monospace, monospace;
  --kj-title-item: 16px;
  --kj-border: 1px dashed
    color-mix(in srgb, var(--text-primary) 18%, transparent);
}

body {
  font-family: "Public Sans", sans-serif;
  color: #000;
  background: transparent;
  margin: 0;
  padding: 12px 0;
  overflow: visible;
}

.kj-border {
  position: relative;
}

/* The dashed rule is drawn either side of the mark/label, so nothing needs a
   filled background to hide the border behind it. */
.kj-border__mark {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 14px;
}

.kj-border__mark::before,
.kj-border__mark::after {
  content: "";
  flex: 1;
  border-top: var(--kj-border);
}

.kj-border__mark {
  top: 0;
  line-height: 0;
  transform: translateY(-50%);
}

.kj-border__mark img {
  display: block;
  width: auto;
  height: 22px;
  max-width: 56px;
  object-fit: contain;
}

.wp-embed.kj-embed {
  padding: 0;
  color: #000;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
}

/* Sits below the card: the dashed rule closes the card, the text hangs under it. */
.kj-embed__label {
  margin: 0 !important;
  padding-top: 8px;
  border-top: var(--kj-border);
  text-align: center;
  font-family: "Space Mono", ui-monospace, monospace;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: color-mix(in srgb, #000 46%, transparent);
  white-space: nowrap;
}

.kj-embed__body {
  border-inline-end: var(--kj-border);
  display: flex;
  align-items: stretch;
  gap: 0;
}

.kj-embed__media {
  flex-shrink: 0;
  width: clamp(112px, 38%, 200px);
  overflow: hidden;
}

.kj-embed__media img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 100%;
  object-fit: cover;
}

.kj-embed__content {
  flex: 1;
  min-width: 0;
  background-color: #f7f7f7;
  padding: 22px 16px 28px;
}

.kj-embed__category,
.kj-embed__category:hover,
.kj-embed__category:focus,
.kj-embed__category:focus-visible,
.kj-embed__category:active,
.kj-embed__category:visited,
.wp-embed.kj-embed .kj-embed__category,
.wp-embed.kj-embed:has(.kj-embed__body:hover) .kj-embed__category,
.wp-embed.kj-embed:has(.kj-embed__title a:hover) .kj-embed__category {
  text-decoration: none !important;
  text-decoration-line: none !important;
}

.kj-embed__category {
  position: relative;
  z-index: 2;
  display: block;
  margin-bottom: 6px;
  font-family: var(--monoFont);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
  color: var(--color-blue);
}

.kj-embed__category:focus-visible {
  outline: 2px solid var(--color-blue);
  outline-offset: 2px;
}

.kj-embed__content > .kj-meta__date,
.kj-embed__content > .sidebar-card__date {
  display: block;
  margin-bottom: 6px;
  font-family: var(--monoFont);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.2;
  text-transform: uppercase;
  color: var(--text-primary);
}

.wp-embed.kj-embed .wp-embed-heading.kj-embed__title {
  margin: 0;
  font-family: var(--primaryFont);
  font-size: var(--kj-title-item);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.kj-embed__title a {
  color: var(--text-primary);
  text-decoration: none;
}

.kj-embed__title a::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

.kj-embed__title a:hover,
.wp-embed.kj-embed .kj-embed__title a:hover {
  text-decoration: none;
}

.kj-embed__title a:focus-visible {
  color: var(--text-primary);
  outline: 2px solid var(--color-blue);
  outline-offset: 2px;
  text-decoration: none;
}

@media (hover: hover) and (pointer: fine) {
  .wp-embed.kj-embed:hover .kj-embed__media img {
    opacity: 0.8;
  }
}

@media (max-width: 659px) {
  .kj-embed__content > .kj-meta__date,
  .kj-embed__content > .sidebar-card__date {
    font-size: 12px;
  }

  :root {
    --kj-title-item: 18px;
  }
}

@media (max-width: 480px) {
  .kj-embed__body {
    border-inline-start: var(--kj-border);
    flex-direction: column;
    gap: 0;
  }

  .kj-embed__media {
    width: 100%;
    max-width: none;
  }

  .kj-embed__media img {
    aspect-ratio: 16 / 9;
    height: auto;
    min-height: 0;
  }

  .kj-embed__content {
    padding: 14px 16px 28px;
  }
}
