/*
 * Lions Club Königs Wusterhausen: white page on a grey-brown backdrop.
 * Loaded for that site only (setup.typoscript, site("identifier")).
 *
 * The backdrop is the theme secondary; header and footer sit on it in white
 * type, the content is one white panel. Headlines and card icons take the
 * theme primary (blue), secondary stays the accent. Selectors hang off the shared page markup in
 * Layouts/Page/Default.html and Templates/Page/Default.html, and use :where()
 * where they would otherwise outrank a block's own colours (the hero band).
 */

body,
body > .w-screen {
  background: var(--theme-secondary, #716460);
}

/* The page is one white panel. Below 2xl it runs edge to edge with square
   corners, as on every other site (Templates/Page/Default.html: w-full
   plus mx-2 / md:mx-8 overflows the centred wrapper evenly and is clipped).
   From 2xl up it is inset from the backdrop with rounded corners, the
   header as wide as the panel; overflow: clip rounds off the full-bleed
   hero at the top. Edge to edge it runs straight into the footer; inset it
   keeps its mb-8 of backdrop above it. */
[data-site-header] ~ .frontend-content {
  overflow: clip;
  margin-bottom: 0;
  background: #fff;
  color: #363538;
}

@media (min-width: 1536px) {
  [data-site-header],
  [data-site-header] ~ .frontend-content {
    width: calc(100% - 4rem);
  }

  [data-site-header] ~ .frontend-content {
    margin-inline: 0;
    margin-bottom: 2rem;
    border-radius: 0.75rem;
  }
}

:where([data-site-header] ~ .frontend-content) :is(h1, h2, h3, h4) {
  color: var(--theme-primary, #003481);
}

:where([data-site-header] ~ .frontend-content) .card__icon {
  color: var(--theme-primary, #003481);
}

/* Header: white type on the backdrop. The crest brings its own white
   shield. The active item is white and underlined (the secondary it uses
   elsewhere is the backdrop here); hover is the light tertiary. Scoped to
   the bar, so the light mobile menu panel keeps its dark type. Once it
   floats the bar turns white and the type takes the backdrop colour (see
   the .is-floating rules below). */
[data-site-header] {
  background-color: var(--theme-secondary, #716460);
  color: #fff;
}

[data-site-header] > div:first-child .text-secondary {
  color: #fff;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.5rem;
}

[data-site-header] > div:first-child .hover\:text-secondary:hover,
[data-site-header] > div:first-child .nav-item:hover {
  color: var(--theme-tertiary, #d9d0cc);
}

[data-site-header] #burger-menu-button svg {
  color: #fff;
}

#mobile-menu {
  color: #000;
}

/* Floating: white bar, backdrop-coloured type and underline, hover in the
   primary blue (the tertiary would vanish on white). */
[data-site-header].is-floating {
  background-color: #fff;
  color: var(--theme-secondary, #716460);
}

[data-site-header].is-floating > div:first-child .text-secondary {
  color: var(--theme-secondary, #716460);
}

[data-site-header].is-floating > div:first-child .hover\:text-secondary:hover,
[data-site-header].is-floating > div:first-child .nav-item:hover {
  color: var(--theme-primary, #003481);
}

[data-site-header].is-floating #burger-menu-button svg {
  color: var(--theme-secondary, #716460);
}

/* "We Serve" (page.company.motto) at the right end of the bar. From xl up,
   where the menu shows, logo and motto get the same width (the logo's own
   16rem), so the menu sits in the middle of the bar. */
.site-header__motto {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 300;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  white-space: nowrap;
  /* The tracking also trails the last letter; pull it back so the word
     ends on the bar's padding like the crest starts on it. */
  margin-right: -0.3em;
}

@media (min-width: 1280px) {
  [data-site-header] > div:first-child > a:first-child,
  [data-site-header] > div:first-child > :has(> .site-header__motto) {
    flex: 0 0 16rem;
  }

  [data-site-header] > div:first-child > :has(> .site-header__motto) {
    justify-content: flex-end;
  }
}

/* The logo sits at 85% of the shared w-48 / md:w-64 on the open bar and
   shrinks further with the floating bar (4.5rem / 5rem high). The PNG is
   the crest on a wide transparent canvas, so width drives its height. */
[data-site-header] > div:first-child > a:first-child img {
  width: 10.2rem;
  transition: width 220ms ease;
}

@media (min-width: 768px) {
  [data-site-header] > div:first-child > a:first-child img {
    width: 13.6rem;
  }
}

[data-site-header].is-floating > div:first-child > a:first-child img {
  width: 9rem;
}

@media (min-width: 768px) {
  [data-site-header].is-floating > div:first-child > a:first-child img {
    width: 10.5rem;
  }
}

/* Footer: a darker shade of the backdrop across the full width, from the
   panel's bottom margin down (the light-grey band gives way to it), type
   in white. */
footer {
  padding-top: 0;
  background: color-mix(in srgb, var(--theme-secondary, #716460) 70%, #000);
}

footer > .bg-\[\#eef1f7\] {
  background: transparent;
}

/* The footer logo is the same wide-canvas PNG as the header's, so centred
   on mobile the crest sat left of the middle. Crop the box to the crest
   (420 × 400 of the 1080 × 400 canvas, at its left edge): same crest size
   as before (w-48 / md:w-64 of the canvas). */
footer .footer-nav img[src$="/Lions_KW_Logo.png"] {
  width: 4.75rem;
  aspect-ratio: 420 / 400;
  object-fit: cover;
  object-position: left center;
}

@media (min-width: 768px) {
  footer .footer-nav img[src$="/Lions_KW_Logo.png"] {
    width: 6.25rem;
  }
}

footer .footer-nav {
  color: #fff;
}

footer .footer-nav .text-secondary {
  color: var(--theme-tertiary, #d9d0cc);
}

footer .footer-nav .hover\:text-secondary:hover {
  color: var(--theme-tertiary, #d9d0cc);
}

footer .footer-nav .fill-black {
  fill: #fff;
}

footer .footer-nav .hover\:fill-secondary:hover {
  fill: var(--theme-tertiary, #d9d0cc);
}

footer .footer-nav .text-gray-400 {
  color: rgb(255 255 255 / 0.7);
}

/* Footer bottom row: from sm up the social icons and the copyright share one
   row under a hairline (copyright left, icons right) instead of two
   stacked rows with their own top margins. */
footer .footer-nav > div > div:last-child > p {
  margin-top: 1rem;
}

@media (min-width: 640px) {
  footer .footer-nav > div > div:last-child {
    flex-direction: row-reverse;
    justify-content: space-between;
    align-items: center;
    padding-top: 1.5rem;
    border-top: 1px solid rgb(255 255 255 / 0.15);
  }

  footer .footer-nav > div > div:last-child > p {
    margin-top: 0;
  }
}

/* Hero button "Weiß, dunkle Schrift": its shared hover is the secondary
   fill, which is the grey-brown here and too dark under the blue type;
   the light tertiary keeps it legible. */
.hero-split__button--color-white {
  --button-hover-bg: var(--theme-tertiary, #d9d0cc);
}

/* Editorial cards ("Unsere Ziele"): several cards per column of a
   3-Spalten container. The running number counts in source order, i.e.
   down each column, so a row read 01 / 04 / 06. From lg up the columns step
   aside (display: contents) and the cards fill the container's own
   three-column grid row by row: 01 02 03 / 04 05 06 / 07, rows aligned,
   with a larger row gap than the grid's column gap. */
@media (min-width: 1024px) {
  .grid:has(> div > .card--editorial) > div:has(> .card--editorial) {
    display: contents;
  }

  /* The column's stacking margin (layout.css, :where(.frontend-content)
     > :not(:first-child)) would push every later card down in its row;
     the grid gap spaces them now. */
  .grid:has(> div > .card--editorial) > div > .card--editorial {
    margin-top: 0;
  }

  .grid:has(> div > .card--editorial) {
    row-gap: 3rem;
  }
}

/* Activity cards (news list): the shared h3 size wrapped long titles to
   five or six lines in a third of the page. Smaller, and cut off after
   three lines; the full title is on the detail page. */
.news-list-view .article .header h3 {
  font-size: 1.5rem;
  line-height: 1.3;
}

.news-list-view .article .header h3 [itemprop='headline'] {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

/* Benefits and highlights blocks (the "Lions Clubs International" trials
   on the home page): heading in the size and colours of the page's other
   section headings (shared h3: 1.875rem / md 2.25rem, primary blue,
   highlight in the secondary at the same light weight, like the RTE spans
   of "Unsere Ziele"). Titles and icons in the primary, as on the editorial
   cards above. Scoped under the block class: the blocks' own stylesheets
   load after this one. */
.benefits .benefits__heading,
.highlights .highlights__heading {
  color: var(--theme-primary, #003481);
  font-size: 1.875rem;
  line-height: 2.25rem;
}

@media (min-width: 768px) {
  .benefits .benefits__heading,
  .highlights .highlights__heading {
    font-size: 2.25rem;
    line-height: 2.5rem;
  }
}

.benefits .benefits__heading-highlight,
.highlights .highlights__heading-highlight {
  color: var(--theme-secondary, #716460);
  font-weight: inherit;
}

.benefits .benefits-row__title,
.highlights .highlight__title {
  color: var(--theme-primary, #003481);
}

.benefits .benefits-row__icon {
  color: var(--theme-primary, #003481);
}
