/*
  V11.9.0 – Responsive foundation: Header + Hero
  Desktop (>850px) is intentionally untouched.
  iPhone is the reference layout.
*/

/* TABLET / MOBILE HEADER */
@media (max-width: 850px) {
  .site-header {
    position: sticky !important;
    top: 0 !important;
    left: auto !important;
    right: auto !important;
    z-index: 1000 !important;
    padding: 8px 14px !important;
    background: rgba(251,250,246,.97) !important;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    pointer-events: auto !important;
  }

  .header-frame {
    width: 100% !important;
    margin: 0 !important;
    display: grid !important;
    grid-template-columns: minmax(0,1fr) auto !important;
    align-items: center !important;
    gap: 12px !important;
    pointer-events: auto !important;
  }

  .site-header .brand,
  .site-header.scrolled .brand,
  .site-header.logo-hidden:not(.logo-gone) .brand {
    position: relative !important;
    inset: auto !important;
    width: min(190px, 56vw) !important;
    max-width: 190px !important;
    height: 66px !important;
    margin: 0 !important;
    padding: 2px 0 !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    pointer-events: auto !important;
  }

  .site-header .logo-spectrum-svg,
  .site-header.scrolled .logo-spectrum-svg {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    object-fit: contain !important;
    transform: none !important;
  }

  .header-frame .nav-shell,
  .site-header.scrolled .nav-shell,
  .site-header.logo-hidden:not(.logo-gone) .nav-shell,
  .site-header.logo-gone .nav-shell {
    position: static !important;
    width: 52px !important;
    min-width: 52px !important;
    max-width: 52px !important;
    min-height: 52px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    transform: none !important;
    pointer-events: auto !important;
  }

  .menu-toggle,
  #mobile-menu-toggle {
    display: inline-flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 52px !important;
    height: 52px !important;
    margin: 0 !important;
    padding: 9px !important;
    position: relative !important;
    z-index: 1002 !important;
  }

  /* Closed state. main.js toggles the existing .open class. */
  .site-header #nav,
  .header-frame #nav {
    display: none !important;
    position: fixed !important;
    top: 82px !important;
    left: 12px !important;
    right: 12px !important;
    width: auto !important;
    max-height: calc(100dvh - 96px) !important;
    margin: 0 !important;
    padding: 16px 18px !important;
    overflow-y: auto !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    gap: 4px !important;
    white-space: normal !important;
    background: rgba(255,255,255,.99) !important;
    border: 1px solid #ece8df !important;
    border-radius: 18px !important;
    box-shadow: 0 20px 46px rgba(0,0,0,.18) !important;
    z-index: 1001 !important;
  }

  .site-header #nav.open,
  .header-frame #nav.open {
    display: flex !important;
  }

  .site-header #nav a,
  .site-header #nav .nav-button {
    width: 100% !important;
    flex: 0 0 auto !important;
    padding: 14px 4px !important;
    text-align: left !important;
    font-size: 18px !important;
    line-height: 1.25 !important;
  }

  /* Ignore historic desktop logo-scroll layout on mobile. */
  .site-header.scrolled .header-frame,
  .site-header.logo-gone .header-frame,
  .site-header.logo-hidden:not(.logo-gone) .header-frame {
    grid-template-columns: minmax(0,1fr) auto !important;
  }
}

/* HOME HERO – single responsive component */
@media (max-width: 850px) {
  #hero.hero {
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: auto 230px !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
  }

  #hero .hero-copy {
    grid-column: 1 !important;
    grid-row: 1 !important;
    width: 100% !important;
    min-height: 0 !important;
    padding: 34px 20px 30px !important;
  }

  #hero .hero-copy .kicker {
    margin: 0 0 9px !important;
    font-size: 12px !important;
    line-height: 1.2 !important;
    letter-spacing: .08em !important;
  }

  #hero .hero-invite {
    max-width: 36ch !important;
    margin: 0 0 14px !important;
    font-size: 16px !important;
    line-height: 1.4 !important;
  }

  #hero h1 {
    max-width: 12ch !important;
    margin: 12px 0 10px !important;
    font-size: clamp(40px, 10.5vw, 58px) !important;
    line-height: .96 !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
  }

  #hero h1 small {
    display: block !important;
    margin-top: 10px !important;
    font-size: 19px !important;
    line-height: 1.22 !important;
  }

  #hero .meta {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 7px 16px !important;
    margin: 17px 0 19px !important;
    font-size: 14px !important;
    line-height: 1.25 !important;
  }

  #hero .actions {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    width: 100% !important;
    margin: 0 !important;
  }

  #hero .actions .button {
    width: 100% !important;
    min-height: 50px !important;
    justify-content: space-between !important;
    padding: 13px 16px !important;
    box-sizing: border-box !important;
  }

  #hero .hero-media {
    grid-column: 1 !important;
    grid-row: 2 !important;
    min-height: 230px !important;
    height: 230px !important;
    order: initial !important;
  }

  #hero .hero-image {
    inset: 0 !important;
    min-height: 0 !important;
    background-position: center 30% !important;
  }

  #hero .hero-media::after {
    background:
      linear-gradient(180deg,var(--hero-color) 0%,rgba(0,0,0,0) 25%,rgba(0,0,0,.08) 100%) !important;
  }

  #hero .hero-stripes {
    width: 72% !important;
    height: 145px !important;
    right: -23% !important;
    bottom: -64px !important;
    opacity: .96 !important;
  }
}

/* Underpage heroes use the same mobile rhythm. */
@media (max-width: 850px) {
  .venues-hero,
  .sponsors-hero {
    min-height: 0 !important;
    padding: 118px 20px 86px !important;
    overflow: hidden !important;
  }

  .venues-hero-copy,
  .sponsors-hero-copy {
    max-width: none !important;
    padding: 0 !important;
  }

  .venues-hero h1,
  .sponsors-hero h1,
  .about-hero h1,
  .page-hero-title {
    max-width: none !important;
    margin-top: 0 !important;
    font-size: clamp(42px, 10.5vw, 58px) !important;
    line-height: .96 !important;
    white-space: normal !important;
    overflow-wrap: normal !important;
  }

  .venues-hero-copy > p:last-child,
  .sponsors-lead,
  .sponsors-hero-copy > p {
    max-width: 34ch !important;
    font-size: 17px !important;
    line-height: 1.45 !important;
  }

  .venues-ribbons,
  .sponsors-ribbons,
  .about-ribbons {
    width: 72vw !important;
    height: 150px !important;
    right: -22vw !important;
    bottom: -62px !important;
  }
}

@media (max-width: 390px) {
  .site-header .brand,
  .site-header.scrolled .brand {
    width: min(168px, 53vw) !important;
    height: 60px !important;
  }

  #hero.hero {
    grid-template-rows: auto 205px !important;
  }

  #hero .hero-copy {
    padding: 28px 16px 24px !important;
  }

  #hero h1 {
    font-size: 37px !important;
  }

  #hero .hero-media {
    min-height: 205px !important;
    height: 205px !important;
  }
}

/* V11.9.2 – gemeinsames Hamburger-Symbol auf allen Seiten */
@media (max-width: 850px) {
  .menu-toggle {
    position: relative !important;
  }

  .menu-toggle::before,
  .menu-toggle::after {
    content: "" !important;
    position: absolute !important;
    left: 50% !important;
    width: 22px !important;
    height: 2px !important;
    background: #111 !important;
    border-radius: 2px !important;
    transform: translateX(-50%) !important;
    pointer-events: none !important;
  }

  .menu-toggle::before {
    top: 16px !important;
    box-shadow: 0 9px 0 #111 !important;
  }

  .menu-toggle::after {
    top: 34px !important;
  }
}

/* V11.9.3 – Vorstandsbild auf Mobile vollständig sichtbar */
@media (max-width: 850px) {
  .about-page .board-photo {
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
  }

  .about-page .board-photo img {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    aspect-ratio: auto !important;
    object-fit: contain !important;
    object-position: center center !important;
  }
}

/* V11.9.7 – Programmtitel Mobile: korrekter Selektor #event-list */
@media (max-width: 850px) {
  #event-list .event-row {
    grid-template-columns: 90px 76px minmax(0,1fr) !important;
    height: auto !important;
    min-height: 150px !important;
  }

  #event-list .event-copy {
    min-width: 0 !important;
    padding: 22px 12px 22px 10px !important;
    overflow: visible !important;
  }

  #event-list .event-copy h3 {
    max-width: 100% !important;
    margin: 0 0 8px !important;
    font-family: Georgia, "Times New Roman", serif !important;
    font-size: clamp(18px, 5.2vw, 24px) !important;
    font-weight: 400 !important;
    line-height: .98 !important;
    letter-spacing: -.01em !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;
    hyphens: auto !important;
  }

  #event-list .event-copy p {
    max-width: 100% !important;
    margin: 4px 0 !important;
    font-size: 13px !important;
    line-height: 1.25 !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
  }
}

@media (max-width: 390px) {
  #event-list .event-row {
    grid-template-columns: 86px 70px minmax(0,1fr) !important;
  }

  #event-list .event-copy {
    padding-left: 9px !important;
    padding-right: 8px !important;
  }

  #event-list .event-copy h3 {
    font-size: clamp(17px, 5vw, 20px) !important;
  }
}

/* V12.1.9 – GoLive Hotfix: Logo im mittleren Desktopbereich */
@media (min-width:851px) and (max-width:1180px){
  .site-header .brand,
  .site-header.scrolled .brand,
  .site-header.logo-hidden:not(.logo-gone) .brand{
    width:260px !important;
    max-width:260px !important;
    height:82px !important;
    padding:0 !important;
    transform:none !important;
  }

  .site-header .logo-spectrum-svg,
  .site-header.scrolled .logo-spectrum-svg{
    width:100% !important;
    height:100% !important;
    max-width:260px !important;
    object-fit:contain !important;
    transform:none !important;
  }

  .site-header .header-frame{
    grid-template-columns:260px minmax(0,1fr) !important;
    gap:26px !important;
  }
}

