/**
 * Activities + Forum content pages — charter-aligned sticky events column.
 * v13 — forum-bagli-hekayeler sticky sidebar + mobile Yeniliklər panel (daab-common `.main` must not shrink grid cell).
 * Sticky is on the grid item (.sidebar), not a nested child, so the panel
 * stays in view while the news feed scrolls (see az/activities.html).
 *
 * Page IDs using this layout must stay in sync with forum sidebar pages in
 * helpers/_forum_layout_pages.py
 */
html[data-daab-page-id="activities"] .content-wrap,
html[data-daab-page-id="forum-official"] .content-wrap,
html[data-daab-page-id="forum-program"] .content-wrap,
html[data-daab-page-id="forum-2024-presentations"] .content-wrap,
html[data-daab-page-id="forum-impressions"] .content-wrap,
html[data-daab-page-id="forum-roadmap"] .content-wrap ,
html[data-daab-page-id="forum-bagli-hekayeler"] .content-wrap ,
html[data-daab-page-id="forum-cooperation"] .content-wrap {
  display: grid !important;
  align-items: start !important;
  overflow: visible !important;
}

/* daab-common.css sets `.main { max-width: var(--max); margin: auto }` for hub
   pages; inside `.content-wrap` grid that can shrink the feed column to ~0. */
html[data-daab-page-id="activities"] .content-wrap > main.news-feed,
html[data-daab-page-id="forum-official"] .content-wrap > main.news-feed,
html[data-daab-page-id="forum-program"] .content-wrap > main.news-feed,
html[data-daab-page-id="forum-2024-presentations"] .content-wrap > main.news-feed,
html[data-daab-page-id="forum-impressions"] .content-wrap > main.news-feed,
html[data-daab-page-id="forum-roadmap"] .content-wrap > main.news-feed ,
html[data-daab-page-id="forum-bagli-hekayeler"] .content-wrap > main.news-feed ,
html[data-daab-page-id="forum-cooperation"] .content-wrap > main.news-feed {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  min-width: 0 !important;
  justify-self: stretch !important;
}

html[data-daab-page-id="activities"] .sidebar,
html[data-daab-page-id="forum-official"] .sidebar,
html[data-daab-page-id="forum-program"] .sidebar,
html[data-daab-page-id="forum-2024-presentations"] .sidebar,
html[data-daab-page-id="forum-impressions"] .sidebar,
html[data-daab-page-id="forum-roadmap"] .sidebar ,
html[data-daab-page-id="forum-bagli-hekayeler"] .sidebar ,
html[data-daab-page-id="forum-cooperation"] .sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-self: start;
}

html[data-daab-page-id="activities"] .news-feed,
html[data-daab-page-id="forum-official"] .news-feed,
html[data-daab-page-id="forum-program"] .news-feed,
html[data-daab-page-id="forum-2024-presentations"] .news-feed,
html[data-daab-page-id="forum-impressions"] .news-feed,
html[data-daab-page-id="forum-roadmap"] .news-feed ,
html[data-daab-page-id="forum-bagli-hekayeler"] .news-feed ,
html[data-daab-page-id="forum-cooperation"] .news-feed {
  min-width: 0 !important;
}

/* Desktop: grid-item sticky sidebar (same as Activities Yeniliklər panel) */
@media (min-width: 1061px) {
  html[data-daab-page-id="activities"] .sidebar,
  html[data-daab-page-id="forum-official"] .sidebar,
  html[data-daab-page-id="forum-program"] .sidebar,
  html[data-daab-page-id="forum-2024-presentations"] .sidebar,
  html[data-daab-page-id="forum-impressions"] .sidebar,
  html[data-daab-page-id="forum-roadmap"] .sidebar ,
html[data-daab-page-id="forum-bagli-hekayeler"] .sidebar ,
html[data-daab-page-id="forum-cooperation"] .sidebar {
    position: sticky !important;
    top: calc(var(--daab-sticky-top-stack, var(--daab-nav-height, 86px)) + 12px) !important;
    align-self: start !important;
    width: 100% !important;
    max-height: calc(100vh - var(--daab-nav-height, 86px) - 28px) !important;
    overflow: visible !important;
    z-index: 20 !important;
  }

  html[data-daab-page-id="activities"] .sidebar-widget,
  html[data-daab-page-id="forum-official"] .sidebar-widget,
  html[data-daab-page-id="forum-program"] .sidebar-widget,
  html[data-daab-page-id="forum-2024-presentations"] .sidebar-widget,
  html[data-daab-page-id="forum-impressions"] .sidebar-widget,
  html[data-daab-page-id="forum-roadmap"] .sidebar-widget ,
html[data-daab-page-id="forum-bagli-hekayeler"] .sidebar-widget ,
html[data-daab-page-id="forum-cooperation"] .sidebar-widget {
    position: static !important;
    top: auto !important;
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    max-height: calc(100vh - var(--daab-nav-height, 86px) - 28px) !important;
    overflow: hidden !important;
  }

  html[data-daab-page-id="activities"] .sidebar-widget .widget-head,
  html[data-daab-page-id="forum-official"] .sidebar-widget .widget-head,
  html[data-daab-page-id="forum-program"] .sidebar-widget .widget-head,
  html[data-daab-page-id="forum-2024-presentations"] .sidebar-widget .widget-head,
  html[data-daab-page-id="forum-impressions"] .sidebar-widget .widget-head,
  html[data-daab-page-id="forum-roadmap"] .sidebar-widget .widget-head ,
html[data-daab-page-id="forum-bagli-hekayeler"] .sidebar-widget .widget-head ,
html[data-daab-page-id="forum-cooperation"] .sidebar-widget .widget-head {
    flex: 0 0 auto !important;
  }

  html[data-daab-page-id="activities"] .sidebar-widget .widget-body,
  html[data-daab-page-id="forum-official"] .sidebar-widget .widget-body,
  html[data-daab-page-id="forum-program"] .sidebar-widget .widget-body,
  html[data-daab-page-id="forum-2024-presentations"] .sidebar-widget .widget-body,
  html[data-daab-page-id="forum-impressions"] .sidebar-widget .widget-body,
  html[data-daab-page-id="forum-roadmap"] .sidebar-widget .widget-body ,
html[data-daab-page-id="forum-bagli-hekayeler"] .sidebar-widget .widget-body ,
html[data-daab-page-id="forum-cooperation"] .sidebar-widget .widget-body {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    overscroll-behavior: contain !important;
    -webkit-overflow-scrolling: touch;
  }
}

/* Tablet / mobile: stacked layout, collapsible panel (no sticky) */
@media (max-width: 1060px) {
  html[data-daab-page-id="activities"] .content-wrap,
  html[data-daab-page-id="forum-official"] .content-wrap,
  html[data-daab-page-id="forum-program"] .content-wrap,
  html[data-daab-page-id="forum-2024-presentations"] .content-wrap,
  html[data-daab-page-id="forum-impressions"] .content-wrap,
  html[data-daab-page-id="forum-roadmap"] .content-wrap ,
html[data-daab-page-id="forum-bagli-hekayeler"] .content-wrap ,
html[data-daab-page-id="forum-cooperation"] .content-wrap {
    align-items: start !important;
  }

  html[data-daab-page-id="activities"] .sidebar,
  html[data-daab-page-id="forum-official"] .sidebar,
  html[data-daab-page-id="forum-program"] .sidebar,
  html[data-daab-page-id="forum-2024-presentations"] .sidebar,
  html[data-daab-page-id="forum-impressions"] .sidebar,
  html[data-daab-page-id="forum-roadmap"] .sidebar ,
html[data-daab-page-id="forum-bagli-hekayeler"] .sidebar ,
html[data-daab-page-id="forum-cooperation"] .sidebar {
    position: static !important;
    top: auto !important;
    max-height: none !important;
    width: 100% !important;
    z-index: 4500 !important;
  }

  html[data-daab-page-id="activities"] .sidebar-widget,
  html[data-daab-page-id="forum-official"] .sidebar-widget,
  html[data-daab-page-id="forum-program"] .sidebar-widget,
  html[data-daab-page-id="forum-2024-presentations"] .sidebar-widget,
  html[data-daab-page-id="forum-impressions"] .sidebar-widget,
  html[data-daab-page-id="forum-roadmap"] .sidebar-widget ,
html[data-daab-page-id="forum-bagli-hekayeler"] .sidebar-widget ,
html[data-daab-page-id="forum-cooperation"] .sidebar-widget {
    position: static !important;
    max-height: none !important;
    display: block !important;
  }

  html[data-daab-page-id="activities"] .sidebar-widget .widget-body,
  html[data-daab-page-id="forum-official"] .sidebar-widget .widget-body,
  html[data-daab-page-id="forum-program"] .sidebar-widget .widget-body,
  html[data-daab-page-id="forum-2024-presentations"] .sidebar-widget .widget-body,
  html[data-daab-page-id="forum-impressions"] .sidebar-widget .widget-body,
  html[data-daab-page-id="forum-roadmap"] .sidebar-widget .widget-body ,
html[data-daab-page-id="forum-bagli-hekayeler"] .sidebar-widget .widget-body ,
html[data-daab-page-id="forum-cooperation"] .sidebar-widget .widget-body {
    flex: none !important;
  }
}

/* Mobile — match az/activities.html Yeniliklər panel (stack, hamburger, collapse) */
@media (max-width: 1060px) {
  html[data-daab-page-id="activities"] .content-wrap,
  html[data-daab-page-id="forum-official"] .content-wrap,
  html[data-daab-page-id="forum-program"] .content-wrap,
  html[data-daab-page-id="forum-2024-presentations"] .content-wrap,
  html[data-daab-page-id="forum-impressions"] .content-wrap,
  html[data-daab-page-id="forum-roadmap"] .content-wrap,
  html[data-daab-page-id="forum-bagli-hekayeler"] .content-wrap,
  html[data-daab-page-id="forum-cooperation"] .content-wrap {
    display: flex !important;
    flex-direction: column !important;
    gap: 22px !important;
  }

  html[data-daab-page-id="activities"] .sidebar,
  html[data-daab-page-id="forum-official"] .sidebar,
  html[data-daab-page-id="forum-program"] .sidebar,
  html[data-daab-page-id="forum-2024-presentations"] .sidebar,
  html[data-daab-page-id="forum-impressions"] .sidebar,
  html[data-daab-page-id="forum-roadmap"] .sidebar,
  html[data-daab-page-id="forum-bagli-hekayeler"] .sidebar,
  html[data-daab-page-id="forum-cooperation"] .sidebar {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    order: 0 !important;
  }

  html[data-daab-page-id="activities"] .news-feed,
  html[data-daab-page-id="forum-official"] .news-feed,
  html[data-daab-page-id="forum-program"] .news-feed,
  html[data-daab-page-id="forum-2024-presentations"] .news-feed,
  html[data-daab-page-id="forum-impressions"] .news-feed,
  html[data-daab-page-id="forum-roadmap"] .news-feed,
  html[data-daab-page-id="forum-bagli-hekayeler"] .news-feed,
  html[data-daab-page-id="forum-cooperation"] .news-feed {
    order: 1 !important;
  }

  html[data-daab-page-id="activities"] .sidebar-widget,
  html[data-daab-page-id="forum-official"] .sidebar-widget,
  html[data-daab-page-id="forum-program"] .sidebar-widget,
  html[data-daab-page-id="forum-2024-presentations"] .sidebar-widget,
  html[data-daab-page-id="forum-impressions"] .sidebar-widget,
  html[data-daab-page-id="forum-roadmap"] .sidebar-widget,
  html[data-daab-page-id="forum-bagli-hekayeler"] .sidebar-widget,
  html[data-daab-page-id="forum-cooperation"] .sidebar-widget {
    overflow: hidden !important;
    border-radius: 18px !important;
  }

  html[data-daab-page-id="activities"] .widget-head,
  html[data-daab-page-id="forum-official"] .widget-head,
  html[data-daab-page-id="forum-program"] .widget-head,
  html[data-daab-page-id="forum-2024-presentations"] .widget-head,
  html[data-daab-page-id="forum-impressions"] .widget-head,
  html[data-daab-page-id="forum-roadmap"] .widget-head,
  html[data-daab-page-id="forum-bagli-hekayeler"] .widget-head,
  html[data-daab-page-id="forum-cooperation"] .widget-head {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    min-height: 58px !important;
  }

  html[data-daab-page-id="activities"] .events-menu-toggle,
  html[data-daab-page-id="forum-official"] .events-menu-toggle,
  html[data-daab-page-id="forum-program"] .events-menu-toggle,
  html[data-daab-page-id="forum-2024-presentations"] .events-menu-toggle,
  html[data-daab-page-id="forum-impressions"] .events-menu-toggle,
  html[data-daab-page-id="forum-roadmap"] .events-menu-toggle,
  html[data-daab-page-id="forum-bagli-hekayeler"] .events-menu-toggle,
  html[data-daab-page-id="forum-cooperation"] .events-menu-toggle {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 auto !important;
    width: 44px !important;
    height: 42px !important;
    min-width: 44px !important;
    opacity: 1 !important;
    visibility: visible !important;
  }

  html[data-daab-page-id="activities"] .sidebar-widget:not(.events-open) .widget-body,
  html[data-daab-page-id="forum-official"] .sidebar-widget:not(.events-open) .widget-body,
  html[data-daab-page-id="forum-program"] .sidebar-widget:not(.events-open) .widget-body,
  html[data-daab-page-id="forum-2024-presentations"] .sidebar-widget:not(.events-open) .widget-body,
  html[data-daab-page-id="forum-impressions"] .sidebar-widget:not(.events-open) .widget-body,
  html[data-daab-page-id="forum-roadmap"] .sidebar-widget:not(.events-open) .widget-body,
  html[data-daab-page-id="forum-bagli-hekayeler"] .sidebar-widget:not(.events-open) .widget-body,
  html[data-daab-page-id="forum-cooperation"] .sidebar-widget:not(.events-open) .widget-body {
    max-height: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    overflow: hidden !important;
  }

  html[data-daab-page-id="activities"] .sidebar-widget.events-open .widget-body,
  html[data-daab-page-id="forum-official"] .sidebar-widget.events-open .widget-body,
  html[data-daab-page-id="forum-program"] .sidebar-widget.events-open .widget-body,
  html[data-daab-page-id="forum-2024-presentations"] .sidebar-widget.events-open .widget-body,
  html[data-daab-page-id="forum-impressions"] .sidebar-widget.events-open .widget-body,
  html[data-daab-page-id="forum-roadmap"] .sidebar-widget.events-open .widget-body,
  html[data-daab-page-id="forum-bagli-hekayeler"] .sidebar-widget.events-open .widget-body,
  html[data-daab-page-id="forum-cooperation"] .sidebar-widget.events-open .widget-body {
    max-height: min(62vh, 520px) !important;
    padding: 12px 16px !important;
    overflow-y: auto !important;
  }

  html[data-daab-page-id="activities"] .timeline-list a,
  html[data-daab-page-id="forum-official"] .timeline-list a,
  html[data-daab-page-id="forum-program"] .timeline-list a,
  html[data-daab-page-id="forum-2024-presentations"] .timeline-list a,
  html[data-daab-page-id="forum-impressions"] .timeline-list a,
  html[data-daab-page-id="forum-roadmap"] .timeline-list a,
  html[data-daab-page-id="forum-bagli-hekayeler"] .timeline-list a,
  html[data-daab-page-id="forum-cooperation"] .timeline-list a {
    min-height: 44px !important;
    padding: 10px 12px !important;
  }
}

/* Photos gallery — same Activities-style sidebar + main column */
html[data-daab-page-id="forum-photos-gallery"] .content-wrap {
  display: grid !important;
  align-items: start !important;
  overflow: visible !important;
}

html[data-daab-page-id="forum-photos-gallery"] .content-wrap > main.news-feed {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  min-width: 0 !important;
  justify-self: stretch !important;
}

html[data-daab-page-id="forum-photos-gallery"] .sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-self: start;
}

html[data-daab-page-id="forum-photos-gallery"] .news-feed {
  min-width: 0 !important;
}

@media (min-width: 1061px) {
  html[data-daab-page-id="forum-photos-gallery"] .sidebar {
    position: sticky !important;
    top: calc(var(--daab-sticky-top-stack, var(--daab-nav-height, 86px)) + 12px) !important;
    align-self: start !important;
    width: 100% !important;
    max-height: calc(100vh - var(--daab-nav-height, 86px) - 28px) !important;
    overflow: visible !important;
    z-index: 20 !important;
  }

  html[data-daab-page-id="forum-photos-gallery"] .sidebar-widget {
    position: static !important;
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    max-height: calc(100vh - var(--daab-nav-height, 86px) - 28px) !important;
    overflow: hidden !important;
  }

  html[data-daab-page-id="forum-photos-gallery"] .sidebar-widget .widget-body {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    overscroll-behavior: contain !important;
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 1060px) {
  html[data-daab-page-id="forum-photos-gallery"] .content-wrap {
    display: flex !important;
    flex-direction: column !important;
    gap: 22px !important;
  }

  html[data-daab-page-id="forum-photos-gallery"] .sidebar {
    order: 0 !important;
    position: static !important;
    width: 100% !important;
  }

  html[data-daab-page-id="forum-photos-gallery"] .news-feed {
    order: 1 !important;
  }

  html[data-daab-page-id="forum-photos-gallery"] .sidebar-widget {
    overflow: hidden !important;
    border-radius: 18px !important;
  }

  html[data-daab-page-id="forum-photos-gallery"] .widget-head {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    min-height: 58px !important;
  }

  html[data-daab-page-id="forum-photos-gallery"] .events-menu-toggle {
    display: inline-flex !important;
  }

  html[data-daab-page-id="forum-photos-gallery"] .sidebar-widget:not(.events-open) .widget-body {
    max-height: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    overflow: hidden !important;
  }

  html[data-daab-page-id="forum-photos-gallery"] .sidebar-widget.events-open .widget-body {
    max-height: min(62vh, 520px) !important;
    padding: 12px 16px !important;
    overflow-y: auto !important;
  }

  html[data-daab-page-id="forum-photos-gallery"] .photos-gallery-cat-btn {
    min-height: 44px !important;
    padding: 10px 12px !important;
  }
}
