/*****************************************************************************************************
* Design Module: Frontpage CSS
******************************************************************************************************/

/* The front page as the block editor builds it (EDITOR-WORKFLOW.md in
   devbuch): the root group holds Neuheiten across the page, then two
   columns, Termine and Blog in the first, Sparten, Programme and Newsletter
   in the second, each section a group with its wrap (redesign, 2026-10-22;
   before, a quote as the headline, Neuheiten in the left column and the rest
   in the right one). The pattern classes (bube-group-*, bube-block-*) take
   their look from the editing module's editing-block.css. */


/*
Layout
---------------------------------------------------------------------------------------------------- */

/* Layout: Columns
--------------------------------------------- */

/* Two equal columns, 60px apart, each running down on its own (user,
   2026-10-22, over the pages' 650 and 400px). The blog's post count, not
   the spacing, evens them out (design-frontpage.js; user, 2026-10-20). */

.home .bube-root > .wp-block-columns {
  column-gap: 60px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
}

/* The ruled label of Neuheiten 45px below the header, where every view
   starts (text.css): the page has no visible title, whose top margin gives
   the other pages their last 5px. */

.home .bube-root {
  padding-top: 0.3125rem;
}

/* Every section 35px above the next, as on the other pages (page.css). */

.home .bube-root .bube-section {
  padding-bottom: 2.1875rem;
}

@media screen and (min-width: 1201px/*mobileSidebarMinWidth*/) {

  .home .bube-root > .wp-block-columns > .wp-block-column > .bube-section:last-child {
    padding-bottom: 0;
  }
}

/* One column below the sidebar's breakpoint, in the order of what a visitor
   looks for after Neuheiten: Sparten, Termine, Newsletter, Blog, Programme.
   Without the Columns block's gap, which would add 24px to the sections'
   35px (user, 2026-10-23). */

@media screen and (max-width: 1200px/*mobileSidebarMaxWidth*/) {

  .home .bube-root > .wp-block-columns {
    display: flex;
    flex-direction: column;
    row-gap: 0;
  }

  .home .bube-root > .wp-block-columns > .wp-block-column {
    display: contents;
  }

  .home .bube-root .bube-section-cats {
    order: 1;
  }

  .home .bube-root .bube-section-events {
    order: 3;
  }

  .home .bube-root .bube-section-newsletter {
    order: 5;
    /* padding-bottom: 0 !important; */
  }

  .home .bube-root .bube-section-news {
    order: 4;
  }

  .home .bube-root .bube-section-seasons {
    order: 2;
  }

  .home .bub-bottom-section {
    margin-top: 0;
  }
}


/* Layout: Sections
--------------------------------------------- */

/* The sections, their ruled headings and the links in them are styled for
   all such pages in core/css/page.css. On the front page, the blocks of a
   section take their spacing from the section, in place of the block gap of
   'theme.json'. */

.home .bube-root .bube-wrap > :not(h2) {
  margin-bottom: 0;
  margin-top: 0;
}

/* One time for every hover on the page, 0.2s, as the Sparten, the season
   boxes, the arrows and the newsletter button have it (user, 2026-10-23); the
   links' general transition is 0.15s. The covers' lift keeps its own rule,
   at the same time (postloops-imagebox.css). */

.home .bube-root a {
  transition: color 0.2s ease, background-color 0.2s ease;
}


/*
Sections
---------------------------------------------------------------------------------------------------- */

/* Neuheiten: One Row
--------------------------------------------- */

/* The titles in one row that scrolls sideways, about six in view, with
   arrows at its ends (design-frontpage.js) and a swipe on phones, where the
   third cover peeks in: a season of any size stays one row, every title in
   it, and the page keeps its length (user, 2026-10-22, in place of the
   masonry in the left column, which a long season stretched far past the
   right one). The covers stand on the foot of boxes of one height. Each
   entry is as wide as its cover, so the gaps between the covers are equal,
   and its caption wraps at the cover's width (user, 2026-10-23; before,
   slots of a sixth of the row left a narrow cover's rest empty, gaps of 24
   to 40px). A cover is at most as wide as such a slot was, so a landscape
   cover stands lower. The block's Masonry still runs; these rules override
   its positions. */

.home .bube-section-products {
  --bub-front-cover-height: 15.5rem;
}

.home .bube-section-products .bub-block-products {
  position: relative;
}

.home .bube-section-products .bub-loop {
  display: flex !important;
  flex-wrap: nowrap !important;
  gap: 1.5rem;
  height: auto !important;
  justify-content: flex-start !important;
  margin: -4px !important;
  opacity: 1 !important;
  overflow-x: auto;
  padding: 4px; /* Room for the focus ring, taken back by the margin. */
  scroll-padding: 4px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.home .bube-section-products .bub-loop::-webkit-scrollbar {
  display: none;
}

.home .bube-section-products .bub-loop .entry {
  flex: 0 0 auto;
  left: auto !important;
  margin: 0 !important;
  opacity: 1 !important;
  position: static !important;
  scroll-snap-align: start;
  top: auto !important;
  transform: none !important;
  width: auto !important;
}

.home .bube-section-products .bub-loop .entry .featimg {
  align-items: flex-end;
  display: flex;
  height: var(--bub-front-cover-height);
  margin: 0 0 0.6rem;
}

.home .bube-section-products .bub-loop .entry .featimg a {
  align-items: flex-end;
  display: flex;
  height: 100%;
}

/* The width from the cover's ratio (design-frontpage.js), so it has its size
   before it loads. */

.home .bube-section-products .bub-loop .entry .featimg img {
  height: auto;
  max-height: 100%;
  max-width: 10.5rem;
  width: calc(var(--bub-front-cover-height) * var(--bub-cover-ratio, 0.65));
}

/* Masonry's fade-in would restart on covers already shown. */

.home .bube-section-products .bub-loop .bub-masonry-item--visible {
  animation: none;
}

.home .bube-section-products .bub-loop .entry .text-container {
  min-width: 100%;
  width: 0;
}

/* On hover the title turns grey as the cover lifts (postloops-imagebox.css),
   both from anywhere on the entry, since cover and title are one target, and
   as the page's other titles (user, 2026-10-23). */

.home .bube-section-products .bub-loop .entry:hover .entry-title a {
  /* color: var(--body-color-acc); */
}

/* The list stops after fifteen titles, the theme's number of the newest,
   whatever an editor sets in the block: a season, series or Sparte shows
   all its titles there, a selection all its picks (user, 2026-10-19). The
   titles beyond are printed and hidden. The link in the ruled label leads
   to all of them. */

.home .bube-section-products .bub-loop .entry:nth-child(n+16 of .entry) {
  display: none;
}

/* The arrows: white discs on the row's ends, half outside it, a light grey
   on hover (user, 2026-10-22: subtle, not the page's tint, which read as a
   see-through disc, nor the buttons' dark green). Hidden at the row's start
   and end. */

.home .bub-front-arrow {
  align-items: center;
  background: #fff;
  border: 1px solid var(--body-rule-def);
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  color: var(--brand1-color-def);
  cursor: pointer;
  display: flex;
  height: 2.75rem;
  justify-content: center;
  padding: 0;
  position: absolute;
  top: calc(var(--bub-front-cover-height) / 2);
  transform: translateY(-50%);
  transition: background-color 0.2s ease;
  width: 2.75rem;
  z-index: 2;
}

.home .bub-front-arrow[hidden] {
  display: none;
}

.home .bub-front-arrow::before {
  content: '\f054'; /* chevron-right */
  font: var(--fa-font-regular);
  font-size: 0.9rem;
}

.home .bub-front-arrow--prev {
  left: -1.375rem;
}

.home .bub-front-arrow--prev::before {
  content: '\f053'; /* chevron-left */
}

.home .bub-front-arrow--next {
  right: -1.375rem;
}

.home .bub-front-arrow:hover {
  background: #e4e4e4;
}

/* Phones: two covers and a part of the third, no arrows. */

@media screen and (max-width: 600px) {

  .home .bube-section-products {
    --bub-front-cover-height: 12rem;
  }

  .home .bube-section-products .bub-loop {
    gap: 1rem;
  }

  .home .bube-section-products .bub-loop .entry .featimg img {
    max-width: 8.5rem;
  }

  .home .bube-section-products .bub-loop .entry .entry-title {
    font-size: 0.8125rem;
  }

  .home .bub-front-arrow {
    display: none;
  }
}


/* Programme: Link Boxes
--------------------------------------------- */

/* The seasons of [bub_product_seasons] as the pages' small link boxes
   (editing-block.css, 'bube-block-link'), side by side (user, 2026-10-22;
   tinted boxes in the slogan font before). */

.home .bube-section-seasons .bub-product-seasons__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.home .bube-section-seasons .bub-product-seasons__item {
  margin: 0;
  padding: 0;
}

.home .bube-section-seasons .bub-product-seasons__item a {
  background: var(--body-background-sh1);
  color: var(--brand1-color-def);
  display: inline-block;
  font-family: var(--caps-font-family);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  line-height: 1;
  padding: 0.45em 0.8em 0.4em;
  text-decoration: none;
  text-transform: uppercase;
  transition: background-color 0.2s;
}

.home .bube-section-seasons .bub-product-seasons__item a:hover {
  background: var(--body-background-sh2);
}


/* Blog: Four to Twelve Posts
--------------------------------------------- */

/* On desktops design-frontpage.js shows four to twelve of the block's
   posts, as many as end the first column level with the second (user,
   2026-10-19 and 2026-10-20; twelve for the front page without events,
   2026-10-22); the block on Home is set to twelve. Without the script and on
   phones, the list stops after six, whatever an editor sets in the block,
   which allows 50. The link in the ruled label leads to all. */

.home .bube-section-news .bub-loop .entry:nth-child(n+7 of .entry) {
  display: none;
}


/* Termine
--------------------------------------------- */

/* The next four events of [bub_eventlist] in the first column before the
   blog, in rows like the blog's: the date in regular green on the left,
   without a weekday (user, 2026-10-23), the town in a small line above the
   title. The date column takes a range within one month, "18.-22. November",
   on one line; a range across two months breaks after its dash, which the
   shortcode allows only there. Upcoming events only, as
   few as there are; with none, the list's no-events message hides the whole
   section and the blog moves up (user, 2026-10-22, in place of past events
   filling up the four). The blog's post count keeps the columns level, and
   the dashboard reminds editors of the gap (events-admin.php). Each row is
   one link over its full size; on hover its title turns grey, as the blog's
   titles and the Sparten's labels (user, 2026-10-23). */

.home .bube-section-events:has(.bub-eventlist__noresults) {
  display: none;
}

.home .bube-section-events .bub-eventlist__list {
  margin: 0;
  padding: 0;
}

.home .bube-section-events .bub-eventlist__item {
  border-bottom: 1px solid var(--body-background-dk2);
}

.home .bube-section-events .bub-eventlist__element {
  color: var(--body-color-def);
  display: grid;
  gap: 0.15rem 1rem;
  grid-template-columns: 8.75rem minmax(0, 1fr);
  padding: 0.6rem 0;
  text-decoration: none;
}

.home .bube-section-events .bub-eventlist__element:hover {
  color: var(--body-color-acc);
}

.home .bube-section-events .bub-eventlist__element:hover .bub-eventlist__title {
  /* text-decoration: underline; */
}

.home .bube-section-events .bub-eventlist__date {
  color: var(--brand1-color-def);
  grid-row: 1 / span 2;
}

.home .bube-section-events .bub-eventlist__date--short {
  display: none;
}

.home .bube-section-events .bub-eventlist__date-part {
  white-space: nowrap;
}

.home .bube-section-events .bub-eventlist__town {
  color: var(--body-color-acc);
  font-family: var(--caps-font-family);
  font-size: 0.7rem;
  grid-column: 2;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.home .bube-section-events .bub-eventlist__title {
  grid-column: 2;
  line-height: 1.35;
}

/* On phones the date on a line of its own above the town, as in the events
   archive, so the title keeps the full width (user, 2026-10-23; beside the
   date column, titles wrapped to three lines). */

@media screen and (max-width: 600px) {

  .home .bube-section-events .bub-eventlist__element {
    grid-template-columns: minmax(0, 1fr);
  }

  .home .bube-section-events .bub-eventlist__date {
    grid-row: auto;
    margin-bottom: 0.3rem;
  }

  .home .bube-section-events :is(.bub-eventlist__town, .bub-eventlist__title) {
    grid-column: 1;
  }
}
