/* Shared card rows for the editorial sections and model index. */
body .card-rail.card-rail {
  --rail-gap: clamp(16px, 2vw, 24px);
  --rail-columns: 3;
  --rail-card-width: calc((100% - (var(--rail-columns) - 1) * var(--rail-gap)) / var(--rail-columns));
  display: grid;
  grid-template: none;
  grid-auto-flow: column;
  grid-auto-columns: var(--rail-card-width);
  gap: var(--rail-gap);
  align-items: stretch;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding: 3px 0 8px;
}

.card-rail:focus-visible { outline-offset: -3px; }
.card-rail > * { min-width: 0; scroll-snap-align: start; scroll-snap-stop: always; }
.card-rail > :last-child { scroll-snap-align: end; }
.card-rail-controls { display: flex; justify-content: end; gap: 12px; margin-top: 10px; }
.card-rail-controls button {
  display: grid;
  place-items: center;
  inline-size: 46px;
  block-size: 46px;
  padding: 0;
  border: 1px solid #e1e1e5;
  border-radius: 50%;
  background: #ededf0;
  color: var(--text-primary);
  cursor: pointer;
}
.card-rail-controls button:hover:not(:disabled) { background: #e1e1e6; }
.card-rail-controls button:disabled { opacity: .45; cursor: default; }
.card-rail-controls button::before {
  content: '';
  inline-size: 9px;
  block-size: 9px;
  border-style: solid;
  border-width: 0 2px 2px 0;
  transform: rotate(-45deg) translate(-1px, -1px);
}
.card-rail-controls button:first-child::before { transform: rotate(135deg) translate(-1px, -1px); }

/* Keep the same type, surfaces and corners from section to section. */
.section h2, .inner h2 { font-weight: 730; letter-spacing: -.045em; }
.section > h2, .section > .wrap > h2 { text-wrap: balance; }
.section h2 + p { line-height: 1.55; }
:is(.comparison, .article-recommendations, .footer) { background: var(--surface); }
.help img, .model-price, .model-valuation { border-radius: 24px; }
.model-price, .model-valuation { border-color: #e1e1e5; }
.home-faq-list details { border-color: #e1e1e5; }

body .steps.card-rail { border: 0; background: transparent; border-radius: 0; }
body .card-rail > :is(.trust-card, .price-card, .guide-card, .review-card, .article-card, .guide-slide),
body .steps.card-rail > li {
  border: 1px solid #e6e6ea;
  border-radius: 24px;
  background: var(--surface);
  box-shadow: none;
  overflow-wrap: anywhere;
}
body .card-rail > :is(.trust-card, .price-card, .guide-card, .review-card, .guide-slide),
body .steps.card-rail > li { padding: clamp(18px, 2.8vw, 32px); }
body :is(.comparison, .article-recommendations) .card-rail > * { background: var(--background); }
body.home .card-rail > .trust-card { display: flex; flex-direction: column; align-items: flex-start; }
body.home .card-rail > .trust-card h3 { margin-top: 13px; }
body.home .card-rail > .trust-card p { margin-top: 8px; }
.card-rail :is(.trust-symbol, .review-initials) { background: var(--background); border-radius: 50%; }
.card-rail .article-copy { padding-bottom: 52px; }
.card-rail .article-card::after { background: var(--surface); }
.card-rail .review-card h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); }
.card-rail .guide-card h3 { font-size: clamp(1.2rem, 2vw, 1.55rem); }
.card-rail .guide-card a { color: inherit; }
.card-rail .guide-card p { margin-bottom: 0; }
.card-rail.reviews-track, .card-rail.article-track { margin-block: 0; }

body .catalog-models.card-rail { --rail-columns: 5; }
.catalog-models.card-rail > li { display: flex; }
.catalog-models.card-rail a {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 18px;
  border: 1px solid #e6e6ea;
  border-radius: 18px;
  background: var(--surface);
  font-weight: 680;
  text-decoration: none;
}
.catalog-models.card-rail a:hover { text-decoration: underline; }
.catalog-models.card-rail a:focus-visible { outline-offset: -3px; }
.guide .card-rail { margin-block: 16px 0; }
.guide .card-rail:not(.guide-cycle-fordjupning) { --rail-columns: 2; }
.guide .card-rail.guide-cycle-fordjupning { --rail-columns: 1; }
.guide .card-rail .guide-slide :is(h2, p):first-child { margin-top: 0; }
.guide .card-rail .guide-cycle-nav { display: none; }

@media (max-width: 1024px) {
  body .card-rail.card-rail { --rail-columns: 2; }
  body .catalog-models.card-rail { --rail-columns: 3; }
}
@media (max-width: 767px) {
  body .card-rail.card-rail { --rail-card-width: min(90%, 390px); }
  body .catalog-models.card-rail { --rail-card-width: min(64%, 190px); }
  body .guide .card-rail.guide-cycle-fordjupning { --rail-card-width: 100%; }
  .card-rail-controls { margin-top: 6px; }
}
