/*
 * Kedauros Connect: the blog layout, ported from kedauros.com/blog.
 *
 * Every rule is scoped under .ked so it cannot leak into the shop, and colours
 * are derived from the theme's own text colour with color-mix instead of being
 * hard-coded. That way the page reads correctly on a light theme and on a dark
 * one without the shop owner configuring anything. --ked-brand is set inline
 * from the site's Brand DNA colour.
 */

.ked {
  --ked-brand: #2454f5;
  --ked-line: color-mix(in srgb, currentColor 14%, transparent);
  --ked-muted: color-mix(in srgb, currentColor 62%, transparent);
  --ked-tint: color-mix(in srgb, currentColor 4%, transparent);
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
  box-sizing: border-box;
}

.ked *,
.ked *::before,
.ked *::after {
  box-sizing: border-box;
}

.ked a {
  text-decoration: none;
  color: inherit;
}

/* ---------- the newest article, poster-sized ---------- */

.ked-featured {
  display: grid;
  grid-template-columns: 3fr 2fr;
  overflow: hidden;
  border: 1px solid var(--ked-line);
  border-radius: 1.5rem;
  margin-top: 3.5rem;
}

.ked-featured .ked-cover {
  border: 0;
  border-radius: 0;
  aspect-ratio: auto;
  min-height: 360px;
}

.ked-featured-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1rem;
  padding: 2.5rem;
}

.ked-eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ked-brand);
}

.ked-featured-body h2 {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  transition: color 0.2s;
}

.ked-featured:hover h2,
.ked-card:hover h3 {
  color: var(--ked-brand);
}

.ked-byline {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: var(--ked-muted);
}

.ked-byline strong {
  display: block;
  font-weight: 600;
  color: inherit;
  opacity: 1;
}

/* ---------- covers ---------- */

.ked-cover {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--ked-line);
  border-radius: 1rem;
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--ked-brand) 10%, transparent),
    transparent 55%,
    color-mix(in srgb, var(--ked-brand) 20%, transparent)
  );
}

.ked-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.ked-card:hover .ked-cover img,
.ked-featured:hover .ked-cover img {
  transform: scale(1.02);
}

/* ---------- topic chips ---------- */

.ked-topics {
  margin-top: 3.5rem;
}

.ked-topics h2 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.ked-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
  margin-top: 1rem;
}

.ked-chips a {
  padding: 0.5rem 1rem;
  border: 1px solid var(--ked-line);
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.2s, border-color 0.2s;
}

.ked-chips a:hover {
  color: var(--ked-brand);
  border-color: color-mix(in srgb, var(--ked-brand) 50%, transparent);
}

/* ---------- one shelf per topic ---------- */

.ked-shelf {
  margin-top: 4rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--ked-line);
}

.ked-shelf-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.ked-shelf-head h2 {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.ked-viewall {
  flex-shrink: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ked-brand);
}

.ked-viewall:hover {
  text-decoration: underline;
}

.ked-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2rem;
  margin-top: 1.75rem;
}

.ked-card-date {
  margin-top: 1rem;
  font-size: 0.75rem;
  color: var(--ked-muted);
}

.ked-card h3 {
  margin: 0.375rem 0 0;
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.01em;
  transition: color 0.2s;
}

.ked-empty {
  margin-top: 3rem;
  padding: 2.5rem;
  border: 1px dashed var(--ked-line);
  border-radius: 1.5rem;
  text-align: center;
  color: var(--ked-muted);
}

/* ---------- the article itself ---------- */

.ked-hero {
  overflow: hidden;
  margin-bottom: 2.5rem;
  border: 1px solid var(--ked-line);
  border-radius: 1.5rem;
}

.ked-hero img {
  display: block;
  width: 100%;
  height: auto;
}

.ked-asides {
  border-top: 1px solid var(--ked-line);
  border-bottom: 1px solid var(--ked-line);
  margin-bottom: 3rem;
}

.ked-aside {
  padding: 1.75rem 0;
}

.ked-aside + .ked-aside {
  border-top: 1px solid var(--ked-line);
}

.ked-aside h2 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.ked-aside ol,
.ked-aside ul {
  margin: 1.25rem 0 0;
  padding-left: 0;
  list-style: none;
}

.ked-aside li {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.75rem;
  line-height: 1.6;
}

.ked-num {
  font-size: 0.875rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: color-mix(in srgb, var(--ked-brand) 60%, transparent);
}

.ked-dot {
  flex-shrink: 0;
  width: 0.375rem;
  height: 0.375rem;
  margin-top: 0.625rem;
  border-radius: 9999px;
  background: var(--ked-brand);
}

.ked-aside a:hover {
  color: var(--ked-brand);
}

/* Keep reading: the internal links that stop every article being a dead end. */

.ked-related {
  margin-top: 4rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--ked-line);
}

.ked-related h2 {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ked-brand);
}

.ked-related ul {
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
}

.ked-related li + li {
  margin-top: 1.25rem;
}

.ked-related a {
  display: block;
}

.ked-related .t {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
  transition: color 0.2s;
}

.ked-related a:hover .t {
  color: var(--ked-brand);
}

.ked-related .m {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: var(--ked-muted);
}

/* The article body as it arrives from Kedauros. The class names in it come
   from the studio's own renderer, which is styled with utility classes; they
   mean nothing here, so the few that carry visual intent are given one. */

.ked-post img {
  max-width: 100%;
  height: auto;
}

.ked-post figure,
.ked-figure {
  margin: 2rem 0;
}

.ked-post figure img,
.ked-figure img {
  width: 100%;
  border-radius: 1rem;
}

.ked-post .text-brand,
.ked-post a {
  color: var(--ked-brand);
}

.ked-post blockquote {
  margin: 1.5rem 0;
  padding-left: 1rem;
  border-left: 2px solid color-mix(in srgb, var(--ked-brand) 40%, transparent);
  font-style: italic;
  color: var(--ked-muted);
}

/* The byline the API appends. It ships with inline styles, but WordPress
   filters some of them out on save, so the layout is restated here. */

.ked-post .kedauros-author {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--ked-line);
  font-size: 0.875rem;
  color: var(--ked-muted);
}

.ked-post .kedauros-author img {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border-radius: 9999px;
  object-fit: cover;
}

/* ---------- phones ---------- */

@media (max-width: 782px) {
  .ked-featured {
    grid-template-columns: 1fr;
  }

  .ked-featured .ked-cover {
    min-height: 0;
    aspect-ratio: 16 / 9;
  }

  .ked-featured-body {
    padding: 1.75rem;
  }

  .ked-featured-body h2 {
    font-size: 1.375rem;
  }

  .ked-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .ked-shelf-head h2 {
    font-size: 1.5rem;
  }
}
