/* The CMS blocks of a page (classic.Blocks) and the main menu's second level; a dealer's style.css,
   loaded after this, can style them further. */

/* Symfony's hidden class (the forms' honeypot, the empty favourites menu); not every dealer's style.css has it */
.hide {
  display: none !important
}
.cms-block {
  padding: 30px 0
}

/* consecutive blocks on the same background share one gap; a block on the accent colour keeps its own
   padding against a plain neighbour */
.cms-block:not(.cms-accent) + .cms-block:not(.cms-accent), .cms-accent + .cms-accent {
  padding-top: 0
}

/* a text block with two columns (the CMS's choice): from lg its text runs over two columns; headings and
   the block's title span both, list items and photos stay whole, a horizontal line (hr) ends the left column */
.cms-text-cols hr {
  display: none
}
@media (min-width: 992px) {
  .cms-text-cols hr {
    display: block;
    break-after: column;
    height: 0;
    margin: 0;
    border: 0;
    opacity: 0
  }
  .cms-text-cols {
    column-count: 2;
    column-gap: 30px
  }
  .cms-text-cols h1, .cms-text-cols h2 {
    column-span: all
  }
  .cms-text-cols li, .cms-text-cols p:has(img), .cms-text-cols img {
    break-inside: avoid
  }
}

.cms-block img {
  max-width: 100%;
  height: auto
}

.cms-textimage-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 30px
}

.cms-textimage-image, .cms-textimage-text {
  flex: 1 1 320px;
  min-width: 0
}

.cms-image-right .cms-textimage-image {
  order: 2
}

/* a text+image block of half or a third width is too narrow for both side by side: the photo on top (it
   comes first in the markup), whatever side the block chose; block, not a flex column, which sizes a
   stretched photo by its natural height */
.cms-col.col-lg-6 .cms-textimage-row, .cms-col.col-lg-4 .cms-textimage-row {
  display: block
}

.cms-col.col-lg-6 .cms-textimage-image, .cms-col.col-lg-4 .cms-textimage-image {
  margin-bottom: 15px
}

.cms-textimage-image img {
  display: block;
  width: 100%;
  border-radius: 4px
}

.cms-contact {
  margin: 6px 0 0
}

.cms-stock-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px
}

.cms-stock-button {
  margin: 20px 0 0;
  text-align: center
}

/* the sitemap: the pages left, the categories right (one under the other on a phone) */
.cms-sitemap {
  margin: 0 0 1.5rem
}

#main_menu li.has-children {
  position: relative
}

#main_menu .sub-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 20;
  min-width: 200px;
  margin: 0;
  padding: 8px 0;
  list-style: none;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .15)
}

#main_menu li.has-children:hover > .sub-menu, #main_menu li.has-children:focus-within > .sub-menu {
  display: block
}

#main_menu .sub-menu li {
  display: block;
  float: none
}

#main_menu .sub-menu a {
  display: block;
  padding: 8px 16px;
  white-space: nowrap
}

@media (max-width: 991px) {
  #main_menu .sub-menu {
    display: block;
    position: static;
    box-shadow: none;
    padding: 0 0 0 16px
  }
}

/* narrower blocks side by side; below 992px each column is full width. The gap also parts columns that
   wrap to a new line (e.g. a form followed by a row of team members) */
.cms-row > .container > .row {
  row-gap: 30px
}

.cms-address {
  margin: 0;
  padding: 0;
  list-style: none
}

.cms-address li {
  margin: 0 0 4px
}

.contact-form-column .content {
  padding: 0
}

.cms-button {
  margin: 20px 0 0
}

/* cards and logos: a grid with the block's number per row on a wide screen, fewer on a smaller one */
.cms-card-grid, .cms-logo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px
}

@media (max-width: 575px) {
  .cms-card-grid {
    grid-template-columns: minmax(0, 1fr)
  }
}

@media (min-width: 768px) {
  .cms-cols-3, .cms-cols-4, .cms-cols-5, .cms-cols-6 {
    grid-template-columns: repeat(3, minmax(0, 1fr))
  }
}

@media (min-width: 992px) {
  .cms-cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr))
  }

  .cms-cols-5 {
    grid-template-columns: repeat(5, minmax(0, 1fr))
  }

  .cms-cols-6 {
    grid-template-columns: repeat(6, minmax(0, 1fr))
  }
}

.cms-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, .1);
  border-radius: 4px;
  background: #fff;
  color: inherit;
  text-decoration: none
}

a.cms-card:hover, a.cms-card:focus-visible {
  box-shadow: 0 4px 14px rgba(0, 0, 0, .12);
  color: inherit;
  text-decoration: none
}

.cms-card-image img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover
}

.cms-card-text {
  padding: 15px
}

.cms-card-text h3 {
  margin: 0 0 8px;
  font-size: 1.15em
}

.cms-card-text p {
  margin: 0;
  white-space: pre-line
}

.cms-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100px;
  padding: 15px
}

.cms-logo img {
  max-width: 100%;
  max-height: 80px;
  object-fit: contain
}

/* slider: a scroll strip with one slide in view, the caption over the image */
.cms-slider-wide {
  padding-top: 0
}

.cms-slider {
  position: relative
}

.cms-slides {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none
}

.cms-slides::-webkit-scrollbar {
  display: none
}

.cms-slide {
  position: relative;
  flex: 0 0 100%;
  height: clamp(260px, 45vw, 560px);
  scroll-snap-align: start;
  background: #333
}

.cms-slide-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover
}

.cms-slide-caption {
  position: absolute;
  inset: auto 0 0;
  padding: 60px 0 40px;
  background: linear-gradient(transparent, rgba(0, 0, 0, .6));
  color: #fff
}

.cms-slide-caption h2 {
  margin: 0 0 10px;
  color: #fff
}

.cms-slide-caption p {
  max-width: 640px;
  margin: 0 0 15px;
  white-space: pre-line
}

.cms-slide-link {
  position: absolute;
  inset: 0
}

.cms-slider-prev, .cms-slider-next {
  position: absolute;
  top: 50%;
  width: 44px;
  height: 44px;
  margin-top: -22px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .8);
  color: #333;
  font-size: 28px;
  line-height: 40px
}

.cms-slider-prev {
  left: 15px
}

.cms-slider-next {
  right: 15px
}

.cms-slider-dots {
  position: absolute;
  right: 0;
  bottom: 12px;
  left: 0;
  display: flex;
  justify-content: center;
  gap: 8px
}

.cms-slider-dots button {
  width: 10px;
  height: 10px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .5)
}

.cms-slider-dots button[aria-current=true] {
  background: #fff
}

/* on a phone the visitor swipes; the arrows would cover the caption */
@media (max-width: 767px) {
  .cms-slider-prev, .cms-slider-next {
    display: none
  }
}

/* the footer's blocks as columns: light text on the themes' dark footer (a theme with a light footer sets
   its own colour in its style.css, loaded after this) */
.cms-footer-col {
  margin-bottom: 20px;
  color: rgba(255, 255, 255, .85)
}

.cms-footer-col h2, .cms-footer-col h3, .cms-footer-col strong {
  color: #fff
}

.cms-footer-col h2 {
  font-size: 1.2em
}

/* no paragraph margin after a footer block's last line: the column's own margin already spaces the blocks */
.cms-footer-col address, .cms-footer-col address > :last-child {
  margin-bottom: 0
}

.cms-map iframe {
  display: block;
  width: 100%;
  height: 300px;
  border: 0
}

.cms-footer-col .cms-map iframe {
  height: 220px
}

/* a video pasted in a text (YouTube iframe, fixed 560x315) scales with its column at 16:9 */
.cms-text iframe, .cms-textimage iframe, .cms-intro iframe {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  margin-bottom: 1rem;
  border: 0
}

.cms-social {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none
}

.cms-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(127, 127, 127, .18);
  color: inherit
}

.cms-social a:hover, .cms-social a:focus-visible {
  background: rgba(127, 127, 127, .35);
  color: inherit
}

.cms-mailinglist {
  margin-top: 15px
}

/* the hero caption's text (HTML from the editor: its lines as headings, h1 the large one) */
.cms-hero-text p:last-child {
  margin-bottom: 0
}

/* the start page's headline is white over the photos (the theme's h1): the CMS text inside it (its <p> and
   headings from the editor, the caption's text) takes that colour instead of the theme's dark p/h colour */
section.hero .hero-headline h1 *, section.hero .hero-headline .cms-hero-text * {
  color: inherit
}

/* the dealer breaks the lines (Shift+Enter); a line too long for the screen wraps in about equal parts */
section.hero .hero-headline h1 {
  text-wrap: balance
}

section.hero .hero-headline .cms-hero-text {
  color: #fff;
  text-shadow: 0 0 30px rgba(0, 0, 0, .2)
}

/* a paragraph in the caption stays a readable column; the headings keep the lines the dealer set */
section.hero .hero-headline .cms-hero-text p {
  max-width: 40em
}

/* ... and keeps the alignment the editor gave it */
section.hero .hero-headline .cms-hero-text p.text-center {
  margin-left: auto;
  margin-right: auto
}

section.hero .hero-headline .cms-hero-text p.text-end {
  margin-left: auto
}

/* a page heading without a hero (no photos in the CMS): a plain dark heading right below the menu instead
   of white text over a photo; specific enough to beat the dealer's style.css, loaded after this */
section.overview-head.cms-no-hero {
  padding: 40px 0 0
}

section.overview-head.cms-no-hero h1, section.overview-head.cms-no-hero h2 {
  color: inherit;
  text-shadow: none
}

section.overview-head.cms-no-hero .overflow {
  display: none
}

/* several hero photos behind a page heading take turns (js/blocks.js): only the active one shows */
.overview-head.cms-hero-fade .image-placeholder {
  opacity: 0;
  transition: opacity .8s ease
}

.overview-head.cms-hero-fade .image-placeholder.active {
  opacity: 1
}

/* a mailing list form's field errors: red, left under the fields (the newsletter section centres its text) */
.cms-mailinglist-box form > ul {
  clear: both;
  margin: 5px 0 0;
  padding: 0;
  list-style: none;
  text-align: left
}

.cms-mailinglist-box form > ul li {
  color: #bf272f
}

/* a mailing list form with the optional name: address, a small name field and the button on one line
   above phone width, under each other on a phone; .cms-mailinglist-box makes these beat the dealer's
   style.css (section.content-newsletter form ..., loaded after this) */
.cms-mailinglist-name {
  margin-bottom: 15px
}

@media (min-width: 601px) {
  .cms-mailinglist-box form.cms-mailinglist-named {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-start
  }

  .cms-mailinglist-box form.cms-mailinglist-named input[type=email] {
    flex: 3 1 0;
    width: auto;
    float: none;
    margin-bottom: 0
  }

  .cms-mailinglist-box form.cms-mailinglist-named .cms-mailinglist-name {
    flex: 1 1 0;
    margin-bottom: 0
  }

  .cms-mailinglist-box form.cms-mailinglist-named > ul {
    flex-basis: 100%
  }
}

/* the category menu beside a list: the open main category and the current category bold, its
   subcategories indented below it (not a red box of its own, as the theme's .filters ul would make it) */
section.overview-results .filters ul.cms-cat-menu li.active > a {
  font-weight: 700
}

section.overview-results .filters ul.cms-cat-menu ul {
  margin: 12px 0 0;
  padding: 0 0 0 15px;
  background: none
}

section.overview-results .filters ul.cms-cat-menu ul li {
  margin-bottom: 8px
}

section.overview-results .filters ul.cms-cat-menu a[aria-current] {
  text-decoration: underline
}

/* the number of ads in a list heading is no accent (the theme colours every span in a heading) */
section.overview-head #list-qty {
  color: inherit
}

/* the social links in the footer's bottom bar, centred in height on the text: every item of the bar aligns
   at the top and the icons' item is as high as a line of the bar (the theme's line-height: 46px) */
.footer-legal ul li {
  vertical-align: top
}

.footer-legal ul li.ft-legal-social {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 46px
}

.footer-legal .ft-legal-social .cms-social {
  justify-content: center
}

.footer-legal .ft-legal-social .cms-social a {
  width: 34px;
  height: 34px
}

/* a YouTube video as the hero's background: it covers its box at 16:9 (cut off at the sides or top), over
   its preview image; clicks go through to the caption. On a phone (where autoplay often fails) the still. */
.cms-hero-video-images {
  background-position: center;
  background-size: cover
}

.cms-hero-video {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  container-type: size
}

section.overview-head .cms-hero-video {
  z-index: -1
}

.cms-hero-video iframe {
  position: absolute;
  top: 50%;
  left: 50%;
  width: max(100cqw, 177.78cqh);
  height: max(100cqh, 56.25cqw);
  border: 0;
  transform: translate(-50%, -50%)
}

@media (max-width: 767px) {
  .cms-hero-video {
    display: none
  }
}

/* the search keyword above a result list, with a cross that shows the list without it */
.cms-search-term {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 20px
}

.cms-search-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #eee;
  color: #222;
  font-size: 14px;
  line-height: 1;
  text-decoration: none
}

.cms-search-clear:hover {
  background: #ddd;
  color: #222;
  text-decoration: none
}

/* the contact form's send button (and the form block's text above it) apart from the last field */
.contact-form .form-submit {
  margin-top: 15px
}

/* a text or text+image block on the accent background (the CMS's choice): a band over the full width, or
   a coloured box in a row (a row of only accent blocks is one band); a dealer's style.css sets its colour */
.cms-accent {
  background-color: #f2f2f2
}

.cms-col.cms-accent {
  padding: 30px;
  border-radius: 6px
}

/* fields a dealer added to a form block: yes/no as radios side by side; a taxation's photo hint */
.cms-field-yesno .radio-inline { display: inline-flex; align-items: center; gap: 6px; margin: 0 24px 0 0; font-weight: normal }
.cms-field-yesno .radio-inline input { margin: 0 }
.taxation-form .help-block { margin: 0 0 6px; font-size: .9em; opacity: .8 }
.taxation-form h3 { margin-top: 24px }
