/* Resource cards: supplied cover art is a wide 3:1 composition. Keep it compact and legible on every viewport. */
.grid .card > img {
  display: block;
  width: 100%;
  height: 150px;
  aspect-ratio: auto;
  object-fit: cover;
  object-position: center;
}

/* Article covers use the full 3:1 composition supplied for this series. */
.article .cover {
  display: block;
  width: 100%;
  height: clamp(130px, 33.333vw, 254px);
  aspect-ratio: auto;
  object-fit: cover;
  object-position: center;
}

/* Override the generic header's mobile line break on the knowledge pages. */
@media (max-width: 600px) {
  header .resource-nav > a:first-child {
    width: auto;
    margin-right: 0;
    font-size: .78rem;
    gap: .4rem;
  }
  header .resource-nav .brand svg { width: 21px; height: 26px; }
  header .resource-nav nav { margin-left: auto; gap: .8rem; }
  header .resource-nav nav a { font-size: .76rem; }
  header .resource-nav nav a:nth-child(2) { display: none; }
}

@media (min-width: 701px) {
  .grid .card > img { height: 165px; }
}

/* Shared resource header and theme controls. */
header .resource-nav {
  width: min(1180px, calc(100% - 2rem));
  flex-wrap: nowrap;
  gap: clamp(.8rem, 2vw, 2rem);
}
header .resource-nav > .merk,
header .resource-nav > .brand { min-width: max-content; }
header .resource-nav > .merk span,
header .resource-nav > .brand span { white-space: nowrap; }
header .resource-nav nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(.55rem, 1.4vw, 1.2rem);
  margin-left: auto;
  white-space: nowrap;
}
.resource-theme-toggle {
  width: 42px;
  height: 38px;
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--rand);
  border-radius: 999px;
  background: var(--diep);
  color: var(--wit);
  cursor: pointer;
  padding: 0;
}
.resource-theme-toggle:hover { border-color: var(--a3); }
.resource-theme-toggle svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.resource-theme-toggle .moon { display: none; }
html[data-theme="dark"] .resource-theme-toggle .sun { display: none; }
html[data-theme="dark"] .resource-theme-toggle .moon { display: block; }

html:not([data-theme="dark"]) .card { box-shadow: var(--panel-shadow); }
html:not([data-theme="dark"]) .callout,
html:not([data-theme="dark"]) .cta-box { background: linear-gradient(120deg,#FFF3D6,#FFE6E1); border-color:#F0CFC5; }
html:not([data-theme="dark"]) .source-box { background:#F7F3F0; }

@media (max-width: 760px) {
  header .resource-nav { width: min(100% - 1.25rem, 1180px); gap: .5rem; }
  header .resource-nav > .merk span em,
  header .resource-nav > .brand span { font-size: .72rem; }
  header .resource-nav nav { gap: .42rem; }
  header .resource-nav nav > a:not(.rv-language-switch):not(:first-child) { display: none; }
  header .resource-nav nav > a:first-child { font-size: .72rem; }
  .resource-theme-toggle { width: 36px; height: 34px; }
}

@media (max-width: 430px) {
  header .resource-nav > .merk em { display: none; }
  header .resource-nav > .brand span { display: none; }
}

/* Topic-specific responsive covers: 16:9 desktop and a deliberate 4:5 mobile crop. */
.card > picture.card-cover,
.article > picture.cover {
  display: block;
  width: 100%;
  overflow: hidden;
  background: #171522;
}
.card > picture.card-cover { aspect-ratio: 16 / 9; }
.article > picture.cover {
  height: auto;
  aspect-ratio: 16 / 9;
  margin: 2.25rem 0 2.8rem;
  border: 1px solid var(--rand);
  border-radius: 17px;
}
.card > picture.card-cover > img,
.article > picture.cover > img {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: inherit;
  object-fit: cover;
  object-position: center;
}

@media (max-width: 700px) {
  .card > picture.card-cover,
  .article > picture.cover { aspect-ratio: 4 / 5; }
}
