/* Archelaos 2.0 — Mobile-first polish shared by all public source pages.
   Keeps the original green/yellow identity, existing drawers and dialogs.
   Intentional last stylesheet: overrides page-local legacy mobile spacing. */
@media (max-width: 760px) {
  html { scroll-padding-top: 76px; }
  /* Scroll the open drawer, not the page underneath it. CSS state avoids
     clobbering modal scripts' inline overflow and restores automatically. */
  body:has(#mainMenu.open),
  body:has(#mobileMenu:not([hidden])) {
    overflow: hidden;
    overscroll-behavior: contain;
  }
  .menu-backdrop.is-open,
  .news-menu-backdrop:not([hidden]) { touch-action: none; }

  /* Shared header: preserve all icons on one line without squeezing identity. */
  #siteHeader.site-header {
    box-sizing: border-box;
    padding-inline: clamp(12px, 4vw, 20px) !important;
    gap: 8px;
  }
  #siteHeader .brand {
    min-width: 0;
    flex: 1 1 auto;
    gap: clamp(4px, 1.3vw, 9px);
  }
  #siteHeader .brand-words { min-width: 0; }
  #siteHeader .brand-words strong {
    font-size: clamp(11px, 3.05vw, 15px) !important;
    letter-spacing: .025em;
  }
  #siteHeader .brand-words small { font-size: clamp(9px, 2.4vw, 11px) !important; }
  #siteHeader .brand-icon {
    max-width: clamp(27px, 8vw, 38px);
    max-height: 38px;
    object-fit: contain;
    flex-shrink: 0;
  }
  #siteHeader .header-actions {
    display: flex;
    flex: 0 0 auto;
    flex-wrap: nowrap;
    align-items: center;
    gap: clamp(3px, 1vw, 8px) !important;
    margin-left: auto;
  }
  #siteHeader .header-actions > :is(a, button) { flex-shrink: 0; }
  #siteHeader .header-actions :is(.circle-action, .hamburger) {
    box-sizing: border-box;
    min-width: 42px !important;
    min-height: 42px !important;
  }

  /* Drawer header and club identity stay accessible as links scroll. */
  #mainMenu.menu-v112 {
    box-sizing: border-box;
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scroll-padding-block: 72px 100px;
    padding-bottom: max(12px, env(safe-area-inset-bottom)) !important;
  }
  #mainMenu.menu-v112 .menu-heading {
    position: sticky;
    top: 0;
    z-index: 6;
    background: #fff;
    flex-shrink: 0;
  }
  #mainMenu.menu-v112 > a,
  #mainMenu.menu-v112 .menu-v112-parent {
    box-sizing: border-box;
    min-height: 48px !important;
    display: flex;
    align-items: center;
    line-height: 1.4 !important;
  }
  #mainMenu.menu-v112 .menu-v112-children-inner a {
    box-sizing: border-box;
    min-height: 46px !important;
    display: flex !important;
    align-items: center;
  }
  #mainMenu.menu-v112 .menu-identity {
    position: sticky !important;
    bottom: -1px !important;
    z-index: 5;
    margin-top: auto !important;
    padding-bottom: max(10px, env(safe-area-inset-bottom)) !important;
    background: #fff !important;
  }
  #mainMenu.menu-v115 .menu-heading a.menu-v115-contact,
  #mainMenu.menu-v115 .menu-heading #closeMainMenu {
    min-width: 44px !important;
    min-height: 44px !important;
    border-radius: 50% !important;
  }

  /* The news page retains its own menu controller but matches the same touch rules. */
  .site-header .nav-right { gap: 7px; }
  .site-header .nav-right .icon-btn {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
  }
  .mobile-menu:not([hidden]) {
    max-height: 100dvh;
    overscroll-behavior: contain;
  }
  .mobile-menu-heading { flex-shrink: 0; }
  .mobile-menu-links {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
  .mobile-menu-links a {
    box-sizing: border-box;
    min-height: 48px !important;
    flex-shrink: 0;
  }
  .mobile-menu .menu-identity { flex-shrink: 0; }

  /* Readability and breathing room, without changing full-bleed section backgrounds. */
  main :is(.shell, .container, .s2-wrap, .c-wrap) {
    box-sizing: border-box;
    max-width: 100%;
  }
  main :is(h1, h2, h3) { overflow-wrap: break-word; }
  main img { max-width: 100%; }
  main :is(p, li) { overflow-wrap: break-word; }
  body :is(input:not([type="checkbox"]):not([type="radio"]), textarea, select) {
    font-size: max(16px, 1em);
  }

  /* Museum/photographic detail: consistently rounded, with readable insets. */
  #overlay .panel {
    box-sizing: border-box;
    border-radius: 22px !important;
    overscroll-behavior: contain;
  }
  #overlay .panel-close-row { gap: 8px; }
  #overlay .panel-tools { min-width: 0; }

  /* Avoid accidental sideways page scrolling from grids or editorial titles. */
  body { max-width: 100%; }
  main { min-width: 0; }
}
/* Keep mobile scrolling on the compositor: the sticky header must not
   resample everything moving underneath it. Reveals retain fade and travel. */
@media (max-width: 760px) and (prefers-reduced-motion: no-preference) {
  #siteHeader.site-header {
    background: #fff !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
  html.js-animate .reveal,
  html.js-animate .reveal.in,
  html.v59-motion-ready main .v59-enter,
  html.v59-motion-ready main .v59-enter.v59-visible,
  .v140-soft-reveal,
  .v140-soft-reveal.v140-shown {
    filter: none !important;
    transition-property: opacity, transform !important;
  }
}
@media (max-width: 360px) {
  #siteHeader.site-header { padding-inline: 9px !important; gap: 4px; }
  #siteHeader .header-actions { gap: 2px !important; }
  #siteHeader .header-actions :is(.circle-action, .hamburger) {
    min-width: 40px !important;
    min-height: 40px !important;
  }
  #siteHeader .brand-words strong { font-size: 10.5px !important; }
  #siteHeader .brand-words small { font-size: 9px !important; }
  #mainMenu.menu-v112 { padding-inline: 12px !important; }
  #mainMenu.menu-v112 .menu-heading .ar-menu-title { max-width: calc(100% - 104px); }
}
@media (max-height: 600px) and (max-width: 760px) {
  #mainMenu.menu-v112 .menu-current-page-banner { margin-bottom: 2px !important; }
  #mainMenu.menu-v112 .menu-identity { padding-top: 6px !important; }
  .mobile-menu .menu-identity { min-height: 52px; }
}
@media (hover: none) and (pointer: coarse) {
  /* Touch has no hover intent: prevent a lingering lifted/zoomed button state. */
  html body #mainMenu.menu-v112 :is(a, .menu-v112-parent):hover,
  html body .mobile-menu-links a:hover,
  html body .site-header :is(button, a):hover {
    translate: none !important;
    scale: 1 !important;
  }
}
@media (prefers-reduced-motion: reduce) {
  #mainMenu.menu-v112.open > a,
  #mainMenu.menu-v112.open > .menu-v112-group,
  #mainMenu.menu-v112.open > .line-break,
  #mainMenu.menu-v112.open > .menu-current-page-banner,
  .mobile-menu:not([hidden]) {
    animation: none !important;
    transition: none !important;
  }
}
