/*
 * BUNK-Gruppe — Phase 3 (Website-Umstrukturierung)
 * Self-contained styles for the new group front page, the BUNK 4.0 page,
 * the AJBV GmbH imprint page and the persistent group header bar.
 *
 * Everything is namespaced under `.bunk-*` (and the `#wpadminbar`-style
 * `.bunk-groupbar` id) so it never bleeds into existing Enfold pages.
 * Ported from the customer-approved mockup (mockup/index.html, 4-0.html,
 * ajb-gmbh.html, styles.css).
 */

/* ─── Design tokens (from design-tokens.md / ajbv.de) ─── */
:root {
  --bunk-gold: #9a8555;
  --bunk-gold-soft: #786333;
  --bunk-ink: #253539;
  --bunk-ink-3: #142428;
  --bunk-line: rgba(154, 133, 85, 0.28);
}

/* ─── Persistent BUNK-Gruppe header bar (all pages) ─── */
.bunk-groupbar {
  position: relative;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 9px 24px;
  background: var(--bunk-ink-3);
  border-bottom: 1px solid var(--bunk-line);
  font-family: "Lato", system-ui, sans-serif;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.bunk-groupbar a {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--bunk-gold);
  font-weight: 700;
  text-decoration: none;
  transition: opacity 140ms ease;
}
.bunk-groupbar a:hover { opacity: 0.78; }
.bunk-groupbar svg { width: 15px; height: 15px; flex-shrink: 0; }
.bunk-groupbar .bunk-groupbar-sep {
  color: rgba(255, 255, 255, 0.32);
  font-weight: 400;
  letter-spacing: 0.12em;
}
/* Keep Enfold's sticky header below the group bar (it is not fixed). */
@media (max-width: 600px) {
  .bunk-groupbar { font-size: 11px; gap: 12px; padding: 8px 16px; }
  .bunk-groupbar .bunk-groupbar-sep { display: none; }
}

/* ─── Shared canvas for the standalone BUNK pages ─── */
.bunk-page {
  font-family: "Lato", system-ui, sans-serif;
  color: #fff;
  background: var(--bunk-ink);
  min-height: 100vh;
}
.bunk-page * { box-sizing: border-box; }
.bunk-page a { color: inherit; text-decoration: none; }
.bunk-bg {
  position: fixed; inset: 0; z-index: 0; overflow: hidden;
  background:
    radial-gradient(ellipse at 30% 40%, rgba(60, 90, 95, 0.35) 0%, transparent 55%),
    radial-gradient(ellipse at 70% 70%, rgba(20, 36, 40, 0.6) 0%, transparent 60%),
    linear-gradient(180deg, #253539 0%, #142428 100%);
  pointer-events: none;
}
.bunk-page > *:not(.bunk-bg) { position: relative; z-index: 1; }

.bunk-placeholder {
  display: inline-block; padding: 1px 9px;
  background: rgba(154, 133, 85, 0.12);
  border: 1px dashed var(--bunk-line);
  color: var(--bunk-gold);
  font-family: ui-monospace, monospace; font-size: 14px;
  border-radius: 3px;
}

/* ─── Group landing (front page) ─── */
.bunk-root-wrap {
  display: flex; flex-direction: column;
  padding: 56px 56px 80px;
  max-width: 1280px; margin: 0 auto;
}
.bunk-root-head {
  display: flex; align-items: center; gap: 28px;
  justify-content: center;
  margin-top: 16px;
}
.bunk-root-mark {
  width: 130px; height: 130px; border-radius: 50%;
  border: 2px solid var(--bunk-gold);
  display: flex; align-items: center; justify-content: center;
  color: var(--bunk-gold); font-size: 38px; font-weight: 800;
  letter-spacing: 0.04em;
  background: rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
}
.bunk-root-title {
  font-size: clamp(48px, 7vw, 96px);
  font-weight: 700;
  color: var(--bunk-gold);
  letter-spacing: -0.01em;
  line-height: 1;
  text-transform: uppercase;
  margin: 0;
}
.bunk-root-lede {
  text-align: center;
  max-width: 720px;
  margin: 28px auto 0;
  font-size: 17px;
  font-weight: 300;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.78);
}

.bunk-cta-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 80px;
  width: 100%;
  align-items: stretch;
}
.bunk-cta-grid + .bunk-cta-grid { margin-top: 24px; }
.bunk-cta {
  display: flex; flex-direction: column;
  padding: 40px 36px 36px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025) 0%, rgba(255, 255, 255, 0.01) 100%);
  border: 1px solid var(--bunk-line);
  border-radius: 24px;
  transition: transform 220ms ease, border-color 220ms ease, background 220ms ease;
  position: relative; overflow: hidden;
  min-height: 420px;
}
.bunk-cta:hover {
  transform: translateY(-4px);
  border-color: var(--bunk-gold);
  background: linear-gradient(180deg, rgba(196, 167, 119, 0.06) 0%, rgba(196, 167, 119, 0.02) 100%);
}
.bunk-cta-mark {
  width: 96px; height: 96px; border-radius: 50%;
  border: 1.5px solid var(--bunk-gold);
  display: flex; align-items: center; justify-content: center;
  color: var(--bunk-gold); font-weight: 800;
  background: rgba(0, 0, 0, 0.2);
  margin-bottom: 28px;
  transition: transform 280ms ease;
  flex-direction: column;
}
.bunk-cta:hover .bunk-cta-mark { transform: scale(1.05); }
.bunk-cta-mark.is-ajb { font-size: 22px; letter-spacing: 0.02em; }
.bunk-cta-mark.is-ajb small { font-size: 8px; letter-spacing: 0.16em; font-weight: 400; font-style: italic; margin-top: 3px; display: block; line-height: 1; }
.bunk-cta-mark.is-bunk { font-size: 18px; letter-spacing: 0.06em; }
.bunk-cta-name {
  font-size: 24px; font-weight: 700;
  color: #fff;
  letter-spacing: 0.01em;
  line-height: 1.2;
  margin-bottom: 18px;
  text-transform: uppercase;
}
.bunk-cta-sub {
  font-size: 12px; font-weight: 700;
  color: var(--bunk-gold);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.bunk-cta-pre {
  font-size: 14px; font-weight: 300;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 12px;
}
.bunk-cta.is-placeholder { border-style: dashed; }
.bunk-cta.is-placeholder .bunk-cta-mark { border-style: dashed; }
.bunk-cta.is-placeholder .bunk-cta-name { color: rgba(255, 255, 255, 0.6); }
.bunk-cta-placeholder-text {
  font-family: ui-monospace, monospace; font-size: 13px;
  color: var(--bunk-gold); background: rgba(154, 133, 85, 0.12);
  border: 1px dashed var(--bunk-line); padding: 6px 10px;
  border-radius: 4px; margin-bottom: 14px;
}
.bunk-cta ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 10px;
  margin-bottom: 28px;
}
.bunk-cta ul li {
  font-size: 15px; font-weight: 300;
  color: rgba(255, 255, 255, 0.82);
  display: flex; align-items: center; gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.bunk-cta ul li::before {
  content: ''; width: 6px; height: 6px;
  background: var(--bunk-gold); border-radius: 50%;
  flex-shrink: 0;
}
.bunk-cta-link {
  margin-top: auto;
  display: inline-flex; align-items: center; gap: 12px;
  color: var(--bunk-gold);
  font-weight: 700; font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  border-top: 1px solid var(--bunk-line);
  padding-top: 20px;
  white-space: nowrap;
}
.bunk-cta-link svg { width: 18px; height: 12px; flex-shrink: 0; transition: transform 200ms ease; }
.bunk-cta:hover .bunk-cta-link svg { transform: translateX(6px); }

.bunk-root-foot {
  margin-top: 56px;
  text-align: center;
  font-size: 11px; letter-spacing: 0.2em;
  color: rgba(255, 255, 255, 0.3);
  text-transform: uppercase;
  font-family: ui-monospace, monospace;
}

@media (max-width: 1100px) {
  .bunk-cta-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 700px) {
  .bunk-root-wrap { padding: 32px 20px 56px; }
  .bunk-cta-grid { grid-template-columns: 1fr; margin-top: 48px; }
  .bunk-root-head { flex-direction: column; text-align: center; gap: 16px; }
  .bunk-root-mark { width: 96px; height: 96px; font-size: 28px; }
}

/* ─── BUNK 4.0 page ─── */
.bunk-40-topnav {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; flex-wrap: wrap;
  padding: 20px 56px;
  background: rgba(20, 36, 40, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--bunk-line);
}
.bunk-40-brand { display: flex; align-items: center; gap: 10px; }
.bunk-40-brand-mark {
  width: 72px; height: 72px; border-radius: 50%;
  border: 1.5px solid var(--bunk-gold);
  display: flex; align-items: center; justify-content: center;
  flex-direction: column;
  color: var(--bunk-gold);
  font-weight: 800; letter-spacing: 0.02em;
  background: rgba(0, 0, 0, 0.15);
}
.bunk-40-brand-mark .bunk-mark-name { font-size: 22px; line-height: 1; }
.bunk-40-brand-mark .bunk-mark-tag {
  font-size: 8px; letter-spacing: 0.18em;
  font-weight: 400; font-style: italic;
  margin-top: 4px; opacity: 0.85;
}
.bunk-40-nav {
  display: flex; align-items: center; gap: 28px;
  font-size: 15px; font-weight: 400;
  color: rgba(255, 255, 255, 0.92);
}
.bunk-40-nav a {
  display: inline-flex; align-items: center;
  padding: 6px 0;
  transition: color 120ms ease;
  white-space: nowrap;
}
.bunk-40-nav a:hover { color: var(--bunk-gold); }

.bunk-hero-40 {
  padding: 60px 56px 80px;
  max-width: 1180px; margin: 0 auto;
  display: flex; flex-direction: column; gap: 32px;
}
.bunk-hero-40 h1 {
  font-weight: 700;
  color: var(--bunk-gold); text-transform: uppercase;
  font-size: clamp(40px, 6vw, 78px);
  line-height: 1; letter-spacing: -0.01em;
  text-align: center;
  margin: 0;
}
.bunk-lede {
  text-align: center; max-width: 760px; margin: 0 auto;
  font-size: 17px; font-weight: 300; line-height: 1.6;
  color: rgba(255, 255, 255, 0.78);
}

.bunk-svc-section {
  padding: 100px 56px;
  border-top: 1px solid var(--bunk-line);
  scroll-margin-top: 120px;
}
.bunk-svc-section-inner { max-width: 900px; margin: 0 auto; }
.bunk-svc-num {
  font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--bunk-gold); opacity: 0.7; margin-bottom: 14px;
}
.bunk-svc-section h2 {
  font-weight: 700; color: var(--bunk-gold); text-transform: uppercase;
  font-size: clamp(28px, 4vw, 52px);
  line-height: 1.05; letter-spacing: -0.01em;
  margin: 0 0 28px;
}
.bunk-svc-body {
  font-size: 17px; font-weight: 300; line-height: 1.65;
  color: rgba(255, 255, 255, 0.78);
  max-width: 720px;
}

.bunk-team-section {
  padding: 100px 56px;
  border-top: 1px solid var(--bunk-line);
  scroll-margin-top: 120px;
}
.bunk-team-inner { max-width: 1100px; margin: 0 auto; }
.bunk-team-inner > h2 {
  font-weight: 700; color: var(--bunk-gold); text-transform: uppercase;
  font-size: clamp(28px, 4vw, 52px);
  line-height: 1.05; letter-spacing: -0.01em;
  margin: 0 0 24px;
}
.bunk-team-intro {
  max-width: 60ch; margin: 0 0 48px;
  color: rgba(255, 255, 255, 0.72);
  font-size: clamp(15px, 2vw, 18px); line-height: 1.6;
}
.bunk-team-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 48px 40px;
}
.bunk-team-card {
  display: flex; flex-direction: column; align-items: center;
  gap: 14px; text-align: center;
}
.bunk-team-avatar {
  width: 120px; height: 120px; border-radius: 50%;
  border: 1.5px solid var(--bunk-gold);
  background: rgba(154, 133, 85, 0.08);
  display: flex; align-items: center; justify-content: center;
  color: rgba(255, 255, 255, 0.55);
  font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
  font-family: ui-monospace, monospace;
}
.bunk-team-name { font-weight: 700; color: var(--bunk-gold); font-size: 16px; letter-spacing: 0.03em; }
.bunk-team-role { font-weight: 300; font-size: 13px; color: rgba(255, 255, 255, 0.6); letter-spacing: 0.05em; font-style: italic; }

.bunk-site-footer {
  border-top: 1px solid var(--bunk-line);
  padding: 24px 56px;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.06em;
}
.bunk-site-footer a { color: var(--bunk-gold); }
.bunk-site-footer a + a { margin-left: 22px; }

@media (max-width: 900px) {
  .bunk-40-topnav { padding: 20px 24px; }
  .bunk-40-nav { gap: 18px; font-size: 14px; flex-wrap: wrap; }
  .bunk-hero-40 { padding: 40px 24px 56px; gap: 28px; }
  .bunk-svc-section, .bunk-team-section { padding: 64px 24px; }
  .bunk-team-grid { grid-template-columns: repeat(2, 1fr); }
  .bunk-site-footer { flex-direction: column; gap: 10px; text-align: center; padding: 20px 24px; }
}
@media (max-width: 600px) {
  .bunk-team-grid { grid-template-columns: 1fr; }
}

/* ─── AJBV GmbH imprint page ─── */
.bunk-back-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 32px 40px;
  font-size: 13px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--bunk-gold);
  transition: opacity 120ms ease;
}
.bunk-back-btn:hover { opacity: 0.75; }
.bunk-back-btn svg { width: 16px; height: 16px; }

.bunk-impressum-page {
  max-width: 680px; margin: 0 auto;
  padding: 20px 40px 120px;
}
.bunk-impressum-page > h1 {
  font-weight: 700; color: var(--bunk-gold); text-transform: uppercase;
  font-size: clamp(32px, 5vw, 60px);
  line-height: 1.05; letter-spacing: -0.01em;
  margin: 0 0 56px;
}
.bunk-impressum-block { display: flex; flex-direction: column; gap: 32px; }
.bunk-impressum-block p {
  font-size: 16px; font-weight: 300; line-height: 1.75;
  color: rgba(255, 255, 255, 0.85);
  margin: 0;
}
.bunk-i-label {
  display: block;
  font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--bunk-gold); font-weight: 700;
  margin-bottom: 8px;
}
@media (max-width: 900px) {
  .bunk-impressum-page { padding: 16px 24px 80px; }
}

/* ─── Phase 4: responsive-overflow guards (no horizontal scroll <= 768px) ─── */
/*
 * Root cause: Enfold's grid.css sets `html { min-width: 910px }` and only lifts
 * it via `html.responsive { min-width: 0 }`. The custom BUNK page templates
 * render an <html> WITHOUT the `responsive` class, so the 910px floor stays
 * active and forces a horizontal scroll on every BUNK page at any viewport
 * below 910px. Scoped to BUNK pages only (`:has(.bunk-page)`) so it never
 * touches normal Enfold pages, which keep their own responsive mechanism.
 */
html:has(.bunk-page) { min-width: 0; }

/*
 * Secondary guards: the standalone BUNK pages also carried several fixed-px
 * max-widths and a non-wrapping top nav. These cap every fixed width to the
 * viewport, let long German compound words break, and stack the BUNK 4.0 nav.
 * Scoped to `.bunk-*` only.
 */
@media (max-width: 768px) {
  /* Cap all fixed-px content widths to the viewport. */
  .bunk-page,
  .bunk-root-wrap,
  .bunk-root-lede,
  .bunk-lede,
  .bunk-svc-body,
  .bunk-impressum-page,
  .bunk-cta-grid,
  .bunk-cta { max-width: 100%; }

  /* Grid / flex items must be allowed to shrink below their content size. */
  .bunk-cta-grid,
  .bunk-team-grid { min-width: 0; }
  .bunk-cta,
  .bunk-cta * { min-width: 0; }

  /* Long compound words and the mono placeholder must wrap, not overflow. */
  .bunk-page { overflow-wrap: anywhere; word-break: break-word; }
  .bunk-placeholder,
  .bunk-cta-placeholder-text { white-space: normal; overflow-wrap: anywhere; }

  /* The CTA link label may wrap on very narrow screens. */
  .bunk-cta-link { white-space: normal; }

  /* BUNK 4.0 top nav: stack brand + links vertically and wrap the links. */
  .bunk-40-topnav { flex-direction: column; align-items: flex-start; gap: 16px; }
  .bunk-40-nav { width: 100%; gap: 14px 20px; }

  /* Group bar: never let the (hidden) tagline or links force a sideways scroll. */
  .bunk-groupbar { flex-wrap: wrap; }
}

/*
 * ─── Swipe affordance for wide TablePress tables (bunk/table-hint.js) ───
 *
 * The wrapper is injected by table-hint.js around any .tablepress that is wider
 * than its container. It makes the table horizontally scrollable (so columns
 * clipped by Enfold's overflow:hidden ancestors become reachable) and hosts a
 * one-time "wischen" chip plus scroll-position edge shadows. All .bunk-* scoped.
 */
.bunk-table-scroll {
  position: relative;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch; /* momentum scroll on iOS */
}
/* Don't paint a focus ring just because we made it programmatically focusable;
   keyboard focus (->:focus-visible) still gets one. */
.bunk-table-scroll:focus { outline: none; }
.bunk-table-scroll:focus-visible { outline: 2px solid var(--bunk-gold); outline-offset: 2px; }

/* Edge shadows: a soft gradient hugging whichever side has more table off-screen.
   Toggled via the --start / --end modifier classes by the script. */
.bunk-table-scroll::before,
.bunk-table-scroll::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 24px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 2;
}
.bunk-table-scroll::before {
  left: 0;
  background: linear-gradient(to right, rgba(20, 36, 40, 0.16), rgba(20, 36, 40, 0));
}
.bunk-table-scroll::after {
  right: 0;
  background: linear-gradient(to left, rgba(20, 36, 40, 0.16), rgba(20, 36, 40, 0));
}
.bunk-table-scroll--start::before { opacity: 1; }
.bunk-table-scroll--end::after { opacity: 1; }

/* The one-time "wischen" chip: a small pill floating bottom-right of the table.
   aria-hidden in the markup; purely a visual nudge, auto-dismissed by the JS. */
.bunk-table-hint {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  font-family: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
  color: #fff;
  background: var(--bunk-ink);
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(20, 36, 40, 0.28);
  opacity: 0.94;
  transition: opacity 0.35s ease, transform 0.35s ease;
  animation: bunk-table-hint-nudge 1.6s ease-in-out 2;
}
.bunk-table-hint__arrow {
  font-size: 14px;
  line-height: 1;
}
.bunk-table-hint--hidden {
  opacity: 0;
  transform: translateY(4px);
  pointer-events: none;
}

/* Gentle horizontal nudge on the chip to read as "swipe sideways". */
@keyframes bunk-table-hint-nudge {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(5px); }
}
@media (prefers-reduced-motion: reduce) {
  .bunk-table-hint { animation: none; }
}

/*
 * ─── Cookie consent bar: mobile rescue (ajbv clone) ───
 *
 * Enfold's avia-snippet-cookieconsent.css renders the "bottom-left" placement
 * as a fixed card of width:25% + left:30px (fine on desktop). On a 375px phone
 * that collapses to a ~94px-wide vertical sliver where the German consent text
 * wraps one word per line and the Ok/Anpassen buttons get buried under the
 * site's bottom floating-contact widget (z-index 999999), so the banner is
 * effectively not dismissable with a tap. We only correct this on narrow
 * viewports and only for the bottom-left variant; desktop is untouched.
 *
 * Scoped to the Enfold cookie classes (no .bunk- prefix possible - it is
 * third-party markup) but fenced inside the mobile media query so it cannot
 * affect any other breakpoint.
 */
@media (max-width: 768px) {
  .avia-cookie-consent.avia-cookiemessage-bottom-left {
    /* Span the viewport as a normal bottom banner instead of a 25% card. */
    width: auto;
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    max-height: 70vh;
    overflow-y: auto;
    box-sizing: border-box;
    /* Sit above the floating contact widget so the buttons are tappable. */
    z-index: 1000000;
  }
  /* Let the message use the full width again (it was squeezed to ~50px). */
  .avia-cookie-consent.avia-cookiemessage-bottom-left .avia_cookie_text {
    width: auto;
  }
  /* Comfortable, full-width tap targets stacked under the text. */
  .avia-cookie-consent.avia-cookiemessage-bottom-left .avia-cookie-consent-button {
    display: block;
    width: 100%;
    margin: 8px 0 0;
    text-align: center;
  }
}

/*
 * ─── Cookie consent: bar/modal double-render (all viewports) ───
 *
 * Root cause of "cookie banner doesn't close / can't reach the settings tabs":
 * in this site's GDPR opt-in configuration, Enfold renders BOTH the compact
 * bottom-left notice bar (.avia-cookie-consent-wrap) AND the full settings
 * modal (Magnific Popup) at the same time - confirmed via dig/DOM inspection
 * at 375px, 768px and 1280px, always, on a fresh (no-consent) visit. The bar
 * is a separate DOM node, not nested inside the modal, so nothing removes it
 * while the modal is open. Depending on page length the bar's fixed box then
 * visually overlaps the modal's own buttons/tabs and - worse, since the
 * "mobile rescue" rule above intentionally raises the bar to
 * z-index:1000000 - physically intercepts every click meant for the modal,
 * so neither "Alle akzeptieren" nor the category tabs ever register a tap.
 * That is almost certainly what the older z-index:1000000 fix above was
 * actually band-aiding ("not dismissable with a tap") without diagnosing the
 * real cause. Enfold's own class name expresses its intent - the modal takes
 * priority once it is forced open - so hide the bar for exactly that state,
 * unconditionally (no media query: reproduced at every width tested).
 */
html.avia-cookie-consent-modal-show-immediately .avia-cookie-consent-wrap {
  display: none !important;
}
