/* -------------------------------------------------------
   Base / Theme
-------------------------------------------------------- */

:root {
    --bg: #ffffff;
    --bg-soft: #f7f7f9;
    --text: #111111;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --accent: #f26b3a;
    --accent-soft: rgba(242, 107, 58, 0.08);
    --radius-lg: 1.25rem;
    --radius-md: 0.75rem;
    --shadow-soft: 0 18px 40px rgba(15, 23, 42, 0.08);
    --shadow-card: 0 14px 30px rgba(15, 23, 42, 0.06);
    --max-width: 1120px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
}

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

.site-body {
    min-height: 100vh;
    background: radial-gradient(circle at top left, #fff7f2 0, #ffffff 40%);
    padding-bottom: 3.5rem; /* safe space for floating UI */
}

.site-main {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2.75rem 1.5rem 4rem;
}

/* -------------------------------------------------------
   Header / Nav
-------------------------------------------------------- */

.site-header {
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(18px);
    position: sticky;
    top: 0;
    z-index: 50;
    min-height: 80px;
}

.site-header__inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 1.1rem 1.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

/* Logo */
.site-logo {
    display: inline-flex;
    align-items: center;
}

.site-logo__img {
    height: 42px;
    width: auto;
    display: block;
}

/* Nav */
.site-nav {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    font-size: 0.95rem;
}

.site-nav a {
    text-decoration: none;
    color: var(--text-muted);
    padding-bottom: 0.2rem;
    border-bottom: 2px solid transparent;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
    color: var(--text);
    border-color: var(--accent);
}

/* Contact link – bold + accent (no pill, no underline) */
.site-nav__link--contact {
    color: var(--accent) !important;
    font-weight: 700;
    border-bottom-color: transparent !important;
}

.site-nav__link--contact:hover {
    opacity: 0.85;
}

/* Language switch (UI) */
.lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.lang-switch__item {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    padding: 0.1rem 0.25rem;
}

.lang-switch__item--active {
    color: var(--text);
    font-weight: 700;
}

.lang-switch__divider {
    color: var(--text-muted);
}

/* -------------------------------------------------------
   Hero
-------------------------------------------------------- */

.hero {
    padding: 3rem 0 2rem;
}

.hero__badge {
    display: inline-flex;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 500;
    background: var(--accent-soft);
    color: var(--accent);
    margin-bottom: 1.25rem;
}

.hero__title {
    font-size: clamp(2rem, 3vw, 2.4rem);
    line-height: 1.2;
    margin: 0 0 1rem;
}

.hero__body {
    max-width: 640px;
    color: var(--text-muted);
    font-size: 0.98rem;
}

.hero__body p {
    margin: 0;
}

.hero__actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.75rem;
}

/* -------------------------------------------------------
   Buttons
-------------------------------------------------------- */

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.65rem 1.3rem;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    text-decoration: none;
    white-space: nowrap;
}

.button--primary {
    background: var(--accent);
    color: #ffffff;
    box-shadow: var(--shadow-soft);
}

.button--ghost {
    background: #ffffff;
    color: var(--text);
    border-color: var(--border);
}

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

.section {
    margin-top: 3rem;
}

.section__title {
    margin: 0 0 0.35rem;
    font-size: 1.4rem;
}

.section__subtitle {
    margin: 0 0 1.75rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.cards-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
}

.cards-list--events {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 1.4rem 1.6rem;
}

.card__title {
    margin: 0 0 0.75rem;
    font-size: 1rem;
    font-weight: 600;
}

.richtext p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Placeholder for empty previews */
.placeholder-media {
    width: 100%;
    height: 180px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(242, 107, 58, 0.16), rgba(0, 0, 0, 0.03));
    margin-bottom: 0.75rem;
}

/* -------------------------------------------------------
   Event cards (home/index)
-------------------------------------------------------- */

.event-card {
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.event-card__link > h3,
.event-card__link > p {
    padding-left: 1.4rem;
    padding-right: 1.4rem;
}

.event-card__link > p:last-child {
    padding-bottom: 1.2rem;
}

.event-card__image {
    position: relative;
    background: var(--bg-soft);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    overflow: hidden;
    min-height: 220px;
}

.event-card__image-img {
    width: 100%;
    height: 260px;
    object-fit: cover;
    display: block;
}

.event-card__body {
    padding: 1.4rem 1.6rem 1.5rem;
}

.event-card__date {
    margin: 0 0 0.4rem;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
}

.event-card__title {
    margin: 0 0 0.4rem;
    font-size: 1.05rem;
    font-weight: 600;
}

.event-card__excerpt {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.event-card__countdown {
    margin-top: 0.6rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent);
}

/* -------------------------------------------------------
   Event Profile Page
-------------------------------------------------------- */

.event-header {
    margin-bottom: 1rem;
}

.event-tagline {
    margin: 0.35rem 0 0;
    color: var(--text-muted);
    font-size: 1rem;
    max-width: 900px;
}

.event-hero {
    margin-top: 1rem;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--bg-soft);
    box-shadow: var(--shadow-card);
}

.event-hero__img {
    width: 100%;
    height: auto;
    display: block;
}

.event-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 1.25rem;
}

.event-meta__item {
    padding: 1rem 1.1rem;
    border-radius: var(--radius-md);
    background: #fff;
    border: 1px solid var(--border);
}

.event-meta__label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.event-meta__value {
    font-weight: 600;
    color: var(--text);
}

.event-meta__countdown {
    color: var(--accent);
}

.event-profile {
    margin-top: 1.5rem;
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 1.25rem;
    align-items: start;
}

.event-pdf__hint {
    margin: 0.75rem 0 0;
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.5;
}

/* -------------------------------------------------------
   Footer
-------------------------------------------------------- */

.site-footer {
    border-top: 1px solid var(--border);
    padding: 1.75rem 1.5rem 2.25rem;
    background: #fafafa;
}

.site-footer__inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1.3fr) minmax(0, 1.3fr);
    gap: 1.75rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.site-footer__brand {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.site-footer__logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.site-footer__img {
    height: 24px;
    width: auto;
    display: block;
}

.site-footer__copy {
    margin: 0;
}

.site-footer__heading {
    margin: 0 0 0.55rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
}

.site-footer__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.site-footer__list li {
    margin-bottom: 0.25rem;
}

.site-footer__links a {
    text-decoration: none;
    color: var(--text-muted);
}

.site-footer__links a:hover {
    color: var(--accent);
}

/* -------------------------------------------------------
   RTL helper
-------------------------------------------------------- */

.rtl {
    direction: rtl;
    text-align: right;
}

/* -------------------------------------------------------
   Responsive
-------------------------------------------------------- */

@media (max-width: 960px) {
    .site-header__inner {
        padding-inline: 1rem;
    }

    .site-main {
        padding-inline: 1rem;
    }

    .cards-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .event-profile {
        grid-template-columns: 1fr;
    }

    .event-meta {
        grid-template-columns: 1fr;
    }

    .site-footer__inner {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 640px) {
    .site-header__inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .hero {
        padding-top: 2rem;
    }

    .hero__actions {
        flex-direction: column;
        align-items: stretch;
    }

    .cards-list,
    .cards-list--events {
        grid-template-columns: 1fr;
    }

    .site-footer__inner {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .lang-switch {
        margin-top: 0.25rem;
    }
}

/* -------------------------------------------------------
   Wagtail userbar (floating feather icon)
-------------------------------------------------------- */

.wagtail-userbar-nav,
.wagtail-userbar {
    bottom: 2.5rem !important;
    right: 1.5rem !important;
}

/* ===========================
   SAFETY PATCH (global)
   Prevent “blank pages” caused by overlays / z-index / overflow traps
   =========================== */

html, body {
  height: auto !important;
  overflow: auto !important;
}

.site-main {
  display: block !important;
  min-height: 60vh;
  position: relative;
  z-index: 2;
}

.site-header,
.site-footer {
  position: relative;
  z-index: 3;
}

/* If any decorative background layer exists, force it behind content */
.page-bg, .bg, .backdrop, .hero-bg, .site-bg, .noise, .grain {
  position: fixed !important;
  inset: 0 !important;
  z-index: 0 !important;
  pointer-events: none !important;
}

/* Make sure generic cards/sections sit above any backgrounds */
.section, .card, .home-sections {
  position: relative;
  z-index: 2;
}

/* HOTFIX: site-main must not be fixed (it hides/pushes all pages) */
.site-main {
  position: relative !important;
  inset: auto !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  width: auto !important;
}


/* -------------------------------------------------------
   Particle Network Canvas
-------------------------------------------------------- */

.hero-canvas-container {
    position: absolute;
    inset: 0;
    overflow: hidden;
    border-radius: var(--radius-lg);
    pointer-events: none;
    z-index: 0;
}

#hero-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* -------------------------------------------------------
   Event Card Padding Fix
-------------------------------------------------------- */

.event-card__link > h3,
.event-card__link > p {
    padding-left: 1.4rem;
    padding-right: 1.4rem;
}

.event-card__link > h3:first-of-type {
    padding-top: 1.2rem;
}

.event-card__link > p:last-of-type {
    padding-bottom: 1.4rem;
}

/* -------------------------------------------------------
   Particle Network Canvas
-------------------------------------------------------- */

.hero-canvas-container {
    position: absolute;
    inset: 0;
    overflow: hidden;
    border-radius: var(--radius-lg);
    pointer-events: none;
    z-index: 0;
}

#hero-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* -------------------------------------------------------
   Hero Section - Larger Size
-------------------------------------------------------- */

.home-section--hero > .card {
    min-height: 520px;
    padding: 3rem 2.5rem;
}

@media (min-width: 768px) {
    .home-section--hero > .card {
        min-height: 620px;
        padding: 4rem 3rem;
    }
}
/* -------------------------------------------------------
   Hero Section - Dynamic Height Fix
-------------------------------------------------------- */

.home-section--hero > .card {
    min-height: auto;
    padding: 2rem;
}

.hero-canvas-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.hero-canvas-container canvas {
    width: 100%;
    height: 100%;
}

/* -------------------------------------------------------
   ANIMATED LOADING SCREEN
-------------------------------------------------------- */

.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.loading-screen.hidden {
  opacity: 0;
  visibility: hidden;
}

.loading-spinner {
  position: relative;
  width: 80px;
  height: 80px;
}

/* Circular spinner */
.loading-spinner__circle {
  position: absolute;
  width: 100%;
  height: 100%;
  border: 3px solid rgba(0, 0, 0, 0.1);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Checkmark (hidden initially) */
.loading-spinner__check {
  position: absolute;
  width: 100%;
  height: 100%;
  opacity: 0;
  transform: scale(0);
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.loading-spinner__check.visible {
  opacity: 1;
  transform: scale(1);
}

.loading-spinner__check svg {
  width: 100%;
  height: 100%;
  stroke: var(--primary);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.loading-spinner__check svg path {
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation: checkmark-draw 0.4s ease forwards;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes checkmark-draw {
  to { stroke-dashoffset: 0; }
}

/* Optional: loading text */
.loading-text {
  position: absolute;
  bottom: -40px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.9rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* -------------------------------------------------------
   FOOTER LOGO FIX
-------------------------------------------------------- */

.site-footer img {
  max-height: 30px;
  width: auto !important;
  height: auto !important;
  object-fit: contain;
}

/* -------------------------------------------------------
   FOOTER CENTER ALIGNMENT FIX
-------------------------------------------------------- */

.site-footer__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2rem 1rem;
}

.site-footer__inner > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  width: 100%;
  max-width: 800px;
}

.site-footer__inner a {
  transition: color 0.2s ease;
}

.site-footer__inner a:hover {
  color: var(--primary) !important;
}

.site-footer__inner img {
  display: block;
  margin: 0 auto;
}

.site-footer__inner p {
  margin: 0;
  text-align: center;
}

/* -------------------------------------------------------
   HAMBURGER BUTTON STYLING
-------------------------------------------------------- */

@media (max-width: 980px) {
  .mobile-menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1002;
  }

  .mobile-menu-toggle span {
    width: 100%;
    height: 3px;
    background: var(--text);
    border-radius: 2px;
    transition: all 0.3s ease;
  }

  .mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
  }

  .mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
  }

  .mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
  }
}

/* -------------------------------------------------------
   MOBILE MENU - CLEAN IMPLEMENTATION
-------------------------------------------------------- */

.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  z-index: 1001;
}

.mobile-menu-toggle span {
  display: block;
  width: 26px;
  height: 3px;
  background: #1a1a1a;
  border-radius: 2px;
  transition: 0.3s;
}

.mobile-menu-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(6px, 6px); }
.mobile-menu-toggle.active span:nth-child(2) { opacity: 0; }
.mobile-menu-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(6px, -6px); }

@media (max-width: 980px) {
  /* Header layout - logo left, hamburger right */
  .site-header__inner {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 0.5rem 1rem !important;
  }

  .site-logo {
    order: 1;
    margin: 0 !important;
  }

  .mobile-menu-toggle {
    display: flex !important;
    order: 3;
  }

  /* RTL - flip hamburger to left */
  .rtl .site-header__inner { flex-direction: row-reverse !important; }

  /* Hide desktop nav */
  .site-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: #ffffff !important;
    box-shadow: -4px 0 20px rgba(0,0,0,0.15);
    transition: right 0.3s ease;
    z-index: 1000;
    padding-top: 80px;
    overflow-y: auto;
  }

  .site-nav.active { right: 0; }

  /* RTL menu slides from left */
  .rtl .site-nav {
    right: auto;
    left: -100%;
    box-shadow: 4px 0 20px rgba(0,0,0,0.15);
    transition: left 0.3s ease;
  }
  .rtl .site-nav.active { left: 0; }

  .site-nav__list {
    display: flex !important;
    flex-direction: column !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .site-nav__list li {
    border-bottom: 1px solid #eee;
  }

  .site-nav__link {
    display: block !important;
    padding: 1rem 1.5rem !important;
    color: #1a1a1a !important;
    font-size: 1rem !important;
    text-decoration: none !important;
  }

  .site-nav__link:hover {
    background: #f5f5f5 !important;
    color: #c8102e !important;
  }

  /* Hide desktop lang toggle, show in menu */
  .site-header > .lang-toggle { display: none !important; }
}

/* Overlay when menu open */
.menu-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 999;
}
.menu-overlay.active { display: block; }

/* Mobile overlay (matches base.html class) */
.mobile-menu-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 999;
}
.mobile-menu-overlay.active { display: block; }

/* Optional: lock scroll when menu open */
body.menu-open { overflow: hidden; }

/* -------------------------------------------------------
   MOBILE NAV FIX - VERTICAL MENU
-------------------------------------------------------- */
@media (max-width: 980px) {
  .site-nav {
    position: fixed !important;
    top: 0 !important;
    right: -100% !important;
    width: 280px !important;
    height: 100vh !important;
    background: #fff !important;
    flex-direction: column !important;
    padding: 80px 0 20px !important;
    box-shadow: -2px 0 10px rgba(0,0,0,0.1) !important;
    transition: right 0.3s ease !important;
    z-index: 9998 !important;
    overflow-y: auto !important;
  }
  
  .site-nav.active {
    right: 0 !important;
  }
  
  .site-nav__link {
    display: block !important;
    padding: 15px 25px !important;
    border-bottom: 1px solid #eee !important;
    color: #1a1a1a !important;
    text-decoration: none !important;
    font-size: 1rem !important;
  }
  
  .site-nav__link:hover {
    background: #f5f5f5 !important;
    color: #c8102e !important;
  }
  
  .lang-switch {
    padding: 15px 25px !important;
    border-bottom: 1px solid #eee !important;
  }
}

/* -------------------------------------------------------
   OVERLAY + LINK FIX
-------------------------------------------------------- */
.mobile-menu-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 9997 !important;
}

.mobile-menu-overlay.active {
  display: block !important;
}

/* Ensure nav links are clickable */
.site-nav__link {
  position: relative;
  z-index: 1;
  pointer-events: auto !important;
}

/* -------------------------------------------------------
   Z-INDEX STACK FIX
-------------------------------------------------------- */
@media (max-width: 980px) {
  .mobile-menu-overlay.active {
    display: block !important;
    position: fixed !important;
    inset: 0 !important;
    background: rgba(0,0,0,0.5) !important;
    z-index: 9990 !important;
  }
  
  .site-nav {
    z-index: 9995 !important;
  }
  
  .site-nav.active .site-nav__link,
  .site-nav.active .lang-switch {
    pointer-events: auto !important;
    cursor: pointer !important;
  }
  
  .mobile-menu-toggle {
    z-index: 9999 !important;
  }
}

/* -------------------------------------------------------
   Z-INDEX STACK FIX
-------------------------------------------------------- */
@media (max-width: 980px) {
  .mobile-menu-overlay.active {
    display: block !important;
    position: fixed !important;
    inset: 0 !important;
    background: rgba(0,0,0,0.5) !important;
    z-index: 9990 !important;
  }
  
  .site-nav {
    z-index: 9995 !important;
  }
  
  .site-nav.active .site-nav__link,
  .site-nav.active .lang-switch {
    pointer-events: auto !important;
    cursor: pointer !important;
  }
  
  .mobile-menu-toggle {
    z-index: 9999 !important;
  }
}

/* =======================================================
   MOBILE MENU CLICK FIX (overlay cannot eat link taps)
   - nav must be above overlay
   - overlay must not block nav
   - links must receive pointer events
======================================================= */
@media (max-width: 980px) {

  /* Ensure header/nav create a stable stacking context */
  .site-header,
  .site-header__inner,
  .site-nav {
    position: relative;
    transform: translateZ(0);
  }

  /* Overlay: clickable only outside nav */
  .mobile-menu-overlay {
    z-index: 9000 !important;
    pointer-events: auto !important;
  }

  /* Nav ALWAYS above overlay */
  .site-nav {
    z-index: 9100 !important;
    pointer-events: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  /* Make every child clickable */
  .site-nav * {
    pointer-events: auto !important;
  }

  /* Links: big tap area */
  .site-nav__link {
    display: block !important;
    position: relative !important;
    z-index: 1 !important;
    pointer-events: auto !important;
    -webkit-tap-highlight-color: rgba(0,0,0,0);
    touch-action: manipulation;
  }

  /* Language form buttons must be tappable too */
  .lang-switch,
  .lang-switch button {
    pointer-events: auto !important;
    touch-action: manipulation;
  }

  /* IMPORTANT: overlay must NOT cover the nav panel area.
     We limit overlay to the visible page area NOT including nav by using padding-right.
     Since nav is 280px, we leave that area "clear". */
  .mobile-menu-overlay.active {
    display: block !important;
    padding-right: 280px !important;
    background: rgba(0,0,0,0.45) !important;
  }

  /* RTL: clear left side instead */
  .rtl .mobile-menu-overlay.active {
    padding-right: 0 !important;
    padding-left: 280px !important;
  }
}


/* -------------------------------------------------------
   CMS LOGIN LINK (Wagtail)
-------------------------------------------------------- */
.site-nav__link--cms {
  color: var(--text) !important;
  border-bottom-color: transparent !important;
  font-weight: 600;
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #ffffff;
}

.site-nav__link--cms:hover {
  color: var(--accent) !important;
  border-color: var(--accent);
}

@media (max-width: 980px) {
  .site-nav__link--cms {
    border: none;
    border-radius: 0;
    background: transparent;
    padding: 15px 25px !important;
  }
}
