/* ============================================
   GLOBAL TOKENS
   ============================================ */
:root {
  /* Mobile layout tokens */
  --mer-header-height-mobile: 140px;
  --mer-gap-header-to-filters-mobile: -100px;
  /* header → filters */
  --mer-gap-filters-to-cards-mobile: -90px;
  /* filters → cards */
}

/* ============================================
   MOBILE LAYOUT (<= 768px)
   Clean, consistent, MER-themed mobile UX
   ============================================ */
@media (max-width: 768px) {

  /* -----------------------------------------
     0. Hide desktop header/nav on mobile
  ----------------------------------------- */
  #masthead,
  .site-header,
  .site-header .main-navigation,
  .site-header .primary-menu,
  .site-header .menu,
  #site-navigation,
  .primary-menu,
  .main-navigation,
  .ui.large.top.fixed.menu,
  #mer_main_menu {
    display: none !important;
  }

  /* Hide desktop top fixed menu on all mobile pages */
  .ui.large.top.fixed.hidden.menu {
    display: none !important;
  }

  /* Hide old Sequence hero on NON–conference-detail pages only */
  .ui.vertical.stripe.segment.first:not(.mer-conference-detail) #sequence,
  .ui.vertical.stripe.segment.first:not(.mer-conference-detail) #sequence .seq-screen,
  .ui.vertical.stripe.segment.first:not(.mer-conference-detail) #sequence .seq-canvas,
  .ui.vertical.stripe.segment.first:not(.mer-conference-detail) #sequence .seq-content,
  .ui.vertical.stripe.segment.first:not(.mer-conference-detail) .mer-home-bottom-widgets {
    display: none !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
  }

  /* -----------------------------------------
     1. Fixed mobile header
  ----------------------------------------- */
  .mer-mobile-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--mer-header-height-mobile);
    z-index: 999;
    background-image: url('/wp-content/uploads/2023/10/5Cancun-Nizuc-Beach.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  }

  /* Logo row: logo left, icons right */
  .mer-mobile-header-inner {
    max-width: 1080px;
    margin: 0 auto;
    padding: 12px 16px 0;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    box-sizing: border-box;
  }

  /* Logo */
  .mer-mobile-logo-link img {
    max-height: 38px;
    width: auto;
    display: block;
  }

  /* Green account circle (dropdown trigger) */
  .mer-mobile-user-dropdown.ui.button {
    position: relative;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 40px !important;
    height: 40px !important;
    padding: 0 !important;
    border-radius: 50% !important;
    background: #21BA45 !important;
    border: 1px solid #21BA45 !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  }

  .mer-mobile-user-dropdown>.user.icon {
    color: #ffffff !important;
    font-size: 20px !important;
    margin: 0 !important;
  }

  /* Orange hamburger */
  .mer-mobile-menu-toggle {
    display: inline-flex !important;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #ff6600;
    border: 1px solid #ff6600;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    padding: 0;
    cursor: pointer;
    margin: 0 !important;
    position: relative !important;
    top: 0 !important;
  }

  .mer-mobile-menu-toggle:hover,
  .mer-mobile-menu-toggle:focus {
    background: #e05500;
    border-color: #e05500;
  }

  .mer-mobile-menu-bar {
    width: 18px;
    height: 2px;
    background: #ffffff;
    border-radius: 2px;
  }

  /* Icons + welcome wrapper (right side) */
  .mer-mobile-header-actions {
    display: flex !important;
    flex-direction: column !important;
    /* icons row, then text */
    align-items: flex-end !important;
    justify-content: center !important;
    gap: 2px !important;
    margin: 2px 0 0 0 !important;
    padding: 0 !important;
  }

  .mer-mobile-header-icons {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 12px !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .mer-mobile-header-icons .mer-mobile-user-dropdown.ui.button,
  .mer-mobile-header-icons .mer-mobile-menu-toggle {
    margin: 0 !important;
    padding: 0 !important;
    align-self: center !important;
  }

  .mer-mobile-welcome {
    margin-top: 10px !important;
    /* gap below icons */
    margin-left: -20px !important;
    /* slight left pull */
    color: #ffffff !important;
    font-size: 14px !important;
    line-height: 1.2;
    text-align: left !important;
    display: block !important;
    white-space: nowrap !important;
    opacity: 0.95;
  }

  /* -----------------------------------------
     2. Mobile spacing – token controlled
  ----------------------------------------- */
  body.mer-has-mobile-header .site,
  body.mer-has-mobile-header .wrap,
  body.mer-has-mobile-header .content,
  body.mer-has-mobile-header .container,
  body.mer-has-mobile-header #content,
  body.mer-has-mobile-header .pusher {
    margin-top: 0 !important;
    padding-top: var(--mer-header-height-mobile) !important;
  }

  body.mer-has-mobile-header .ui.vertical.stripe.segment.first,
  body.home .ui.vertical.stripe.segment.first {
    padding-top: 0 !important;
    margin-top: 0 !important;
  }

  #content,
  .site-content,
  .content-area,
  .wrap,
  .pusher {
    padding-top: 0 !important;
    margin-top: 0 !important;
  }

  #content>*:first-child,
  .site-content>*:first-child,
  .content-area>*:first-child,
  .wrap>*:first-child,
  .pusher>*:first-child {
    padding-top: 0 !important;
    margin-top: 0 !important;
  }

  /* Filters under hero (conference list) */
  #mer_advanced_search_box {
    margin-top: var(--mer-gap-header-to-filters-mobile) !important;
    margin-bottom: var(--mer-gap-filters-to-cards-mobile) !important;
  }

  #mer_advanced_search_box .row {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
  }

  .ui.aligned.grid.container {
    margin-top: 0 !important;
  }

  .ui.vertical.stripe.segment {
    padding-top: 1rem !important;
    padding-bottom: 1.5rem !important;
    margin-top: 0 !important;
  }

  /* -----------------------------------------
     3. Single-page layouts (FAQ, Contact, etc.)
  ----------------------------------------- */
  .pusher.single-page .ui.vertical.segment.first {
    padding-top: 0 !important;
    margin-top: 0 !important;
  }

  .pusher.single-page .ui.vertical.segment.first .ui.breadcrumb {
    margin-top: 18px !important;
    margin-bottom: 4px !important;
  }

  .pusher.single-page .ui.vertical.segment.first .ui.divider {
    margin-top: 4px !important;
    margin-bottom: 0 !important;
  }

  .pusher.single-page .ui.vertical.segment.first .ui.divider+* {
    margin-top: 0 !important;
  }

  .pusher.single-page .ui.vertical.segment.first .ui.aligned.stackable.grid.container {
    margin-top: 0 !important;
    padding-top: 0 !important;
  }

  .pusher.single-page .ui.vertical.segment.first .ui.aligned.stackable.grid.container>.row {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
  }

  .pusher.single-page .sp-faq-wrapper,
  .pusher.single-page .sp-faq {
    margin-top: 0 !important;
    padding-top: 0 !important;
  }

  /* Contact + Accreditation specific */
  body.page-template-page-contactus .pusher.single-page .ui.vertical.stripe.segment.first,
  body.page-template-page-accredition .pusher.single-page .ui.vertical.stripe.segment.first {
    padding-top: 0.5rem !important;
    margin-top: 0 !important;
  }

  body.page-template-page-contactus .pusher.single-page .ui.vertical.stripe.segment.first .ui.breadcrumb,
  body.page-template-page-accredition .pusher.single-page .ui.vertical.stripe.segment.first .ui.breadcrumb {
    margin-top: 18px !important;
    margin-bottom: 4px !important;
  }

  body.page-template-page-contactus .pusher.single-page .ui.vertical.stripe.segment.first .ui.divider,
  body.page-template-page-accredition .pusher.single-page .ui.vertical.stripe.segment.first .ui.divider {
    margin-top: 4px !important;
    margin-bottom: 0 !important;
  }

  body.page-template-page-contactus .pusher.single-page .ui.vertical.stripe.segment.first .ui.container,
  body.page-template-page-accredition .pusher.single-page .ui.vertical.stripe.segment.first .ui.container {
    margin-top: 0 !important;
    padding-top: 0 !important;
  }

  body.page-template-page-contactus .pusher.single-page .ui.vertical.stripe.segment.first .ui.container h1:first-child,
  body.page-template-page-contactus .pusher.single-page .ui.vertical.stripe.segment.first .ui.container h2:first-child,
  body.page-template-page-contactus .pusher.single-page .ui.vertical.stripe.segment.first .ui.container h3:first-child,
  body.page-template-page-accredition .pusher.single-page .ui.vertical.stripe.segment.first .ui.container h1:first-child,
  body.page-template-page-accredition .pusher.single-page .ui.vertical.stripe.segment.first .ui.container h2:first-child,
  body.page-template-page-accredition .pusher.single-page .ui.vertical.stripe.segment.first .ui.container h3:first-child {
    margin-top: 0.35rem !important;
  }

  body.page-template-page-contactus .pusher.single-page .ui.vertical.stripe.segment.first .ui.container p:first-child,
  body.page-template-page-accredition .pusher.single-page .ui.vertical.stripe.segment.first .ui.container p:first-child {
    margin-top: 0.35rem !important;
  }

  /* FAQ template */
  body.page-template-page-faq-php .pusher.single-page .ui.vertical.stripe.segment.first {
    padding-top: 0.5rem !important;
    margin-top: 0 !important;
  }

  body.page-template-page-faq-php .pusher.single-page .ui.vertical.stripe.segment.first .ui.breadcrumb {
    margin-top: 18px !important;
    margin-bottom: 4px !important;
  }

  body.page-template-page-faq-php .pusher.single-page .ui.vertical.stripe.segment.first .ui.divider {
    margin-top: 4px !important;
    margin-bottom: 0 !important;
  }

  body.page-template-page-faq-php .pusher.single-page .ui.vertical.stripe.segment.first .ui.container {
    margin-top: 0 !important;
    padding-top: 0 !important;
  }

  body.page-template-page-faq-php .pusher.single-page .ui.vertical.stripe.segment.first .ui.container h1:first-child,
  body.page-template-page-faq-php .pusher.single-page .ui.vertical.stripe.segment.first .ui.container h2:first-child,
  body.page-template-page-faq-php .pusher.single-page .ui.vertical.stripe.segment.first .ui.container h3:first-child {
    margin-top: 0.35rem !important;
  }

  body.page-template-page-faq-php .pusher.single-page .ui.vertical.stripe.segment.first .ui.container p:first-child,
  body.page-template-page-faq-php .pusher.single-page .ui.vertical.stripe.segment.first .ui.container .sp-faq-wrapper:first-child {
    margin-top: 0.35rem !important;
  }

  /* FAQ hard clamp (page-id-1699) */
  body.page-id-1699 .pusher.single-page .ui.vertical.segment.first {
    padding-top: 0.5rem !important;
    margin-top: 0 !important;
  }

  body.page-id-1699 .pusher.single-page .ui.vertical.segment.first .ui.breadcrumb {
    margin-top: 18px !important;
    margin-bottom: 4px !important;
  }

  body.page-id-1699 .pusher.single-page .ui.vertical.segment.first .ui.divider {
    margin-top: 4px !important;
    margin-bottom: 0 !important;
  }

  body.page-id-1699 .pusher.single-page .ui.vertical.segment.first .ui.aligned.stackable.grid.container {
    margin-top: 0 !important;
    padding-top: 0 !important;
  }

  body.page-id-1699 .pusher.single-page .ui.vertical.segment.first .ui.aligned.stackable.grid.container>.row {
    padding-top: 0 !important;
  }

  body.page-id-1699 .pusher.single-page .ui.vertical.segment.first .ui.container {
    margin-top: 0 !important;
    padding-top: 0 !important;
  }

  body.page-id-1699 .pusher.single-page .ui.vertical.segment.first .ui.container>*:first-child {
    margin-top: 0.35rem !important;
  }

  body.page-id-1699 .pusher.single-page .sp-faq-wrapper,
  body.page-id-1699 .pusher.single-page .sp-faq {
    margin-top: 0.35rem !important;
    padding-top: 0 !important;
  }

  /* -----------------------------------------
     4. Homepage: mobile sidebar & hero
  ----------------------------------------- */
  body.home #mer_mobile_main_sidebar .mer-mobile-sidebar-header,
  body.home #mer_mobile_main_sidebar .mer-mobile-sidebar-close-item {
    display: flex !important;
  }

  body.home #mer_mobile_main_sidebar {
    padding-top: 0 !important;
  }

  body.home #mer_mobile_main_sidebar .item {
    padding: 1rem 1.25rem !important;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
  }

  body.home #mer_mobile_main_sidebar .mer-mobile-sidebar-close-icon {
    font-size: 1.4rem !important;
  }

  /* Hide old home hero on mobile */
  body.home #sequence,
  body.home #sequence .seq-screen,
  body.home #sequence .seq-canvas,
  body.home #sequence .seq-content,
  body.home .mer-home-bottom-widgets {
    display: none !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
  }

  /* -----------------------------------------
     5. Profile page (mobile)
  ----------------------------------------- */
  .mer-profile-page .ui.aligned.stackable.grid.container {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  .mer-profile-page .ui.breadcrumb.column {
    padding-left: 0 !important;
    padding-right: 0 !important;
    font-size: 0.85rem !important;
  }

  .mer-profile-page h1.ui.header {
    font-size: 1.4rem !important;
    margin-top: 0.5rem !important;
    margin-bottom: 0.75rem !important;
  }

  .mer-profile-page .profile-tab {
    display: flex !important;
    flex-wrap: wrap;
    justify-content: flex-start;
    overflow-x: visible;
    white-space: normal;
  }

  .mer-profile-page .profile-tab .item {
    flex: 1 1 auto;
    text-align: center;
    font-size: 0.9rem !important;
    padding: 0.6rem 0.8rem !important;
  }

  .mer-profile-page .ui.form .fields {
    flex-direction: column !important;
  }

  .mer-profile-page .ui.form .fields>.field {
    width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .mer-profile-page .ui.form .three.fields,
  .mer-profile-page .ui.form .two.fields {
    margin-bottom: 0.75rem !important;
  }

  .mer-profile-page svg {
    max-width: 100% !important;
    height: auto !important;
    display: block;
  }

  .mer-profile-page .ui.tab.segment {
    padding: 1rem !important;
  }

  .mer-profile-page .mer-freq-attender-block {
    margin: 0 0 1rem 0 !important;
    text-align: center;
  }

  .mer-profile-page .mer-freq-attender-block svg {
    max-width: 100% !important;
    height: auto !important;
    display: inline-block;
  }

  /* -----------------------------------------
     6. Cards / lists – tighten spacing
  ----------------------------------------- */
  .ui.cards .card .image,
  .card .image {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
  }

  .ui.cards .card .content,
  .card .content {
    padding-top: 8px !important;
    margin-top: 0 !important;
  }

  /* -----------------------------------------
     7. Hide old single-page masthead banner
  ----------------------------------------- */
  .pusher.single-page>.ui.inverted.vertical.masthead.center.aligned.segment.banner {
    display: none !important;
    height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
  }

  /* -----------------------------------------
     8. Mobile sidebars (main + user)
  ----------------------------------------- */
  #mer_mobile_main_sidebar,
  #mer_mobile_user_sidebar {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    height: 100vh !important;
    max-height: 100vh !important;
    width: 80% !important;
    /* drawer width 70–85% */
    max-width: 360px !important;
    transform: translateX(100%) !important;
    z-index: 1100 !important;
    background: #111111 !important;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 0 !important;
    overflow-y: auto !important;
  }

  #mer_mobile_main_sidebar.visible,
  #mer_mobile_user_sidebar.visible {
    transform: translateX(0) !important;
  }

  .mer-mobile-sidebar-header {
    display: flex !important;
    align-items: center;
    justify-content: flex-start;
    padding: 0.9rem 1.25rem !important;
    background: #1b1b1b;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.95rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    position: relative !important;
    z-index: 1200 !important;
    pointer-events: auto !important;
  }

  .mer-mobile-sidebar-close {
    border: none;
    background: none;
    color: #ffffff;
    font-size: 1.4rem;
    line-height: 1;
    padding: 0.25rem 0.75rem !important;
    cursor: pointer;
    position: relative !important;
    z-index: 1200 !important;
    pointer-events: auto !important;
  }

  .mer-mobile-sidebar-close-item {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1.25rem !important;
    background: #111111;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
  }

  .mer-mobile-sidebar-close-icon {
    font-size: 1.4rem;
    line-height: 1;
  }

  #mer_mobile_main_sidebar .item,
  #mer_mobile_user_sidebar .item {
    font-size: 1rem;
    padding: 1rem 1.25rem !important;
  }

  #mer_mobile_main_sidebar .item+.item,
  #mer_mobile_user_sidebar .item+.item {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
  }

  .pusher.dimmed:after {
    background-color: rgba(0, 0, 0, 0.55) !important;
  }

  /* -----------------------------------------
     9. Mobile visibility helpers
  ----------------------------------------- */
  .mer_mobile_hidden,
  .mer-mobile-hidden {
    display: none !important;
  }

  .mer-mobile-only {
    display: block !important;
  }

  .mer-desktop-only {
    display: none !important;
  }

  /* -----------------------------------------
    10. Conference page header strip
  ----------------------------------------- */
  .mer_single_grid .row .two.wide.column.mer-mobile-header-fix {
    display: none !important;
  }

  .mer_single_grid .row .fourteen.wide.column {
    width: 100% !important;
  }

  .mer_single_grid .row .fourteen.wide.column h1.ui.header {
    font-size: 1.4rem !important;
    line-height: 1.3 !important;
    margin-top: 0.5rem !important;
    margin-bottom: 0.75rem !important;
  }

  .ui.vertical.stripe.segment.first .ui.aligned.stackable.grid.container {
    padding-top: 0.75rem !important;
    margin-top: 0 !important;
  }

  .ui.vertical.stripe.segment.first .ui.divider:first-of-type {
    margin-top: 0.75rem !important;
  }

  /* -----------------------------------------
    11. Conference detail – layout + sticky footer
  ----------------------------------------- */

  /* Stack image above details card */
  .mer-conference-detail .mer-conf-hero-grid>.row>.nine.wide.column,
  .mer-conference-detail .mer-conf-hero-grid>.row>.seven.wide.column {
    width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .mer-conference-detail .mer-conf-hero-grid>.row>.seven.wide.column {
    margin-top: 1rem !important;
  }

  .mer-conference-detail .mer-conf-hero-grid .ui.fluid.card {
    border-radius: 8px !important;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
  }

  /* Keep location hero images on for conference pages */
  .mer-conference-detail .mer-conf-hero-grid #sequence,
  .mer-conference-detail .mer-conf-hero-grid #sequence .seq-screen,
  .mer-conference-detail .mer-conf-hero-grid #sequence .seq-canvas,
  .mer-conference-detail .mer-conf-hero-grid #sequence .seq-content {
    display: block !important;
    height: auto !important;
    margin: 0 0 1rem 0 !important;
    padding: 0 !important;
    overflow: visible !important;
  }

  .mer-conference-detail .mer-conf-hero-grid #sequence img {
    width: 100% !important;
    height: auto !important;
    display: block !important;
  }

  /* Allow content to grow */
  .mer-conference-detail .mer_single_grid,
  .mer-conference-detail .mer_single_grid .row,
  .mer-conference-detail .mer_single_grid .column,
  .mer-conference-detail .mer_single_grid .ui.fluid.no-border.card {
    height: auto !important;
    overflow: visible !important;
  }

  /* Space at bottom so footer doesn't cover text */
  .mer-conference-detail .mer_single_grid {
    padding-bottom: 90px !important;
    /* footer height + buffer */
  }

  /* Sticky footer: button only (no price) */
  .mer-sticky-footer.mer-mobile-only {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 1000 !important;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #ffffff;
    border-top: 1px solid #e0e0e0;
    padding: 8px 16px 10px;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
  }

  .mer-footer-action {
    width: 100%;
    flex: 0 0 auto;
    margin-left: 0;
  }

  .mer-footer-action .ui.button {
    margin: 0 !important;
    width: 100%;
    border-radius: 999px !important;
    font-weight: 600 !important;
    white-space: nowrap;
  }

  /* Hide card-level fee line on detail card; hero now shows price */
  .mer-conference-detail .mer-info-registration {
    display: none !important;
  }

  .mer-mobile-fee-line {
    margin-top: 6px;
    font-size: 0.9rem;
  }

  .mer-mobile-fee-line .label {
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
    color: #777;
    margin-right: 6px;
  }

  .mer-mobile-fee-line .value {
    font-weight: 700;
    color: #1678c2;
    /* MER blue */
  }



  /* Mobile tweaks */
  @media (max-width: 768px) {
    .mer-venue-hero-img {
      max-height: 260px;
      object-fit: cover;
    }

    .mer-venue-thumb img {
      width: 64px;
      height: 42px;
    }
  }

    /* -----------------------------------------
     11b. Mobile conference summary card
  ----------------------------------------- */
  .mer-conference-detail .mer-conference-summary-card {
    margin: 0 0 1rem 0 !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
    overflow: hidden;
  }

  /* Tighten padding on the visible content block */
  .mer-conference-detail .mer-conference-summary-card > .content:nth-child(2) {
    padding: 12px 16px 14px !important;
  }

  /* Date pill */
  .mer-conference-detail .mer-conference-summary-card .ui.label {
    display: inline-flex;
    align-items: center;
    margin-bottom: 6px !important;
    font-size: 0.85rem !important;
    background: #F3F4F6 !important;
    color: #374151 !important;
    border-radius: 999px !important;
    padding: 4px 10px !important;
  }

  .mer-conference-detail .mer-conference-summary-card .ui.label .calendar.icon {
    margin-right: 6px !important;
  }

  /* Course title inside the card */
  .mer-conference-detail .mer-conference-summary-card h4.ui.sub.header {
    font-size: 0.95rem !important;
    line-height: 1.4 !important;
    margin-top: 2px !important;
    margin-bottom: 0 !important;
    font-weight: 600 !important;
    text-transform: none;
  }

  /* Info list rows (Early Bird / Expires) */
  .mer-conference-detail .mer-conference-summary-card .mer-info-list {
    margin-top: 10px !important;
  }

  .mer-conference-detail .mer-conference-summary-card .mer-info-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 0.85rem;
    padding: 4px 0;
    border-bottom: 1px solid #f3f4f6;
  }

  .mer-conference-detail .mer-conference-summary-card .mer-info-item:last-child {
    border-bottom: none;
  }

  .mer-conference-detail .mer-conference-summary-card .mer-info-item .label {
    color: #6B7280;
    font-weight: 500;
  }

  .mer-conference-detail .mer-conference-summary-card .mer-info-item .value {
    font-weight: 600;
    color: #111827;
  }

  /* Reduce white space above "The Venetian" mobile card */
  .mer-conference-detail .mer-conference-summary-card {
    margin-top: 0.5rem !important;       /* pull card closer to gallery */
  }

  /* Tighten inner padding — the largest white space culprit */
  .mer-conference-detail .mer-conference-summary-card > .content:nth-child(2) {
    padding-top: 6px !important;
    padding-bottom: 8px !important;
  }

  /* Reduce padding for the entire card */
  .mer-conference-detail .mer-conference-summary-card .content {
    padding-top: 6px !important;
    padding-bottom: 6px !important;
  }

  /* Reduce spacing between card sections */
  .mer-conference-detail .mer-conference-summary-card .ui.label {
    margin-bottom: 4px !important;
  }

  .mer-conference-detail .mer-conference-summary-card h4.ui.sub.header {
    margin-top: 0 !important;
    margin-bottom: 2px !important;
  }

  /* Remove extra vertical gaps caused by Semantic UI segments */
  .mer-conference-detail .mer-conference-summary-card .mer-info-list {
    margin-top: 4px !important;
  }

  .mer-conference-detail .mer_single_grid .ui.fluid.no-border.card {
  margin: 0 0 0.5rem 0 !important;
  box-shadow: none !important;
  }

  .mer-conference-detail .mer_single_grid .ui.items.segment {
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 0.75rem 1rem 1.25rem !important;
  }

  .mer-conference-detail .mer-conference-summary-card .mer-summary-venue-line {
  margin-top: 4px;
  font-size: 0.85rem;
  color: #6B7280;
  }

  /* Mobile: make hero card sit tight under the gallery */
  .mer-conference-detail .mer-conf-hero-grid.middle.aligned > .row {
    align-items: flex-start !important;   /* instead of middle-aligned */
  }

  /* Don't vertically center individual columns in the row */
  .mer-conference-detail .mer-conf-hero-grid.middle.aligned > .row > .column {
    display: block !important;
  }

  /* Reduce the extra gap above the summary card */
  .mer-conference-detail .mer-conf-hero-grid > .row > .seven.wide.column {
    margin-top: 0.35rem !important;       /* was ~1rem; tighten */
  }

  /* Slightly tighten the padding inside the card */
  .mer-conference-detail .mer-conference-summary-card > .content:nth-child(2) {
    padding-top: 8px !important;
    padding-bottom: 12px !important;
  }

  /* Remove gap between "The Venetian" card and tab buttons */
  .mer-conference-detail .mer-conference-summary-card {
    margin-bottom: 0.5rem !important;   /* was ~1.5rem */
  }

  .mer-conference-detail .mer_tab_menu.menu {
    margin-top: 0 !important;           /* eliminates top gap */
  }

  /* Also collapse the row wrapper spacing */
  .mer-conference-detail .mer_single_grid .row:first-child {
    padding-top: 0 !important;
    margin-top: 0 !important;
  }

  /* Tighten spacing between tab menu and tab content card */
  .mer-conference-detail .mer_single_grid .ui.fluid.no-border.card > .content {
    padding-top: 0 !important;
    margin-top: 0 !important;
  }

  /* Remove default top space on the first tab segment */
  .mer-conference-detail .ui.bottom.tab.segment[data-tab="first"] {
    padding-top: 0.5rem !important;  /* reduced from ~1.5rem */
    margin-top: 0 !important;
  }

  /* Remove spacing introduced by .ui.items.segment wrapper */
  .mer-conference-detail .ui.items.segment {
    margin-top: 0 !important;
    padding-top: 0.5rem !important;  /* soft padding only */
  }

  /* Make the entire tab content container sit closer to the tab bar */
  .mer-conference-detail .mer_single_grid .row {
    padding-top: 0 !important;
    margin-top: 0 !important;
  }

  /* Conference Note text container – keep it inside the card */
  .mer-conference-detail .ui.items.segment .item .content {
    max-width: 100%;
    box-sizing: border-box;
  }

  /* Slightly reduce padding around the note on mobile */
  .mer-conference-detail .ui.items.segment {
    padding: 0.75rem 1rem 1.25rem !important;
  }

  /* Reduce top padding on the content card under the tabs */
  .mer-conference-detail .mer_single_grid .ui.fluid.no-border.card > .content {
    padding-top: 6px !important; /* was ~20px */
  }

  /* Reduce the top padding of the content box */
  .mer-conference-detail .ui.items.segment {
    padding-top: 10px !important;  /* was much larger */
  }

  .mer-conference-detail h4.header {
  margin-top: 0.25rem !important; /* tighten */
  }

  /* === MOBILE: tighten top of Conference Note card === */
  @media (max-width: 768px) {

    /* 1) Remove extra padding/margin at the top of the tab content area */
    .mer-conference-detail .ui.bottom.tab.segment {
      margin-top: 0 !important;
      padding-top: 0.25rem !important; /* small breathing room only */
    }

    /* 2) Kill the automatic margin on the first .ui.items inside tab 1 */
    .mer-conference-detail .ui.bottom.tab.segment[data-tab="first"] > .ui.items:first-child {
      margin-top: 0 !important;
    }

    /* 3) Tighten the header margin inside the items list */
    .mer-conference-detail .ui.items .item .content > .header {
      margin-top: 0.25rem !important;
    }

    /* 4) Make sure the card wrapper itself isn't re-adding space */
    .mer-conference-detail .mer_single_grid .ui.fluid.no-border.card > .content {
      padding-top: 0 !important;
    }
  }

  /* === MOBILE: remove extra white space above "Conference Note" === */
  @media (max-width: 768px) {

    /* 1) Kill top padding on the first tab's segment */
    .mer-conference-detail .ui.bottom.tab.segment[data-tab="first"] {
      padding-top: 0 !important;
      margin-top: 0 !important;
    }

    /* 2) Remove the margin/padding on the first .ui.items inside that segment
          Use :first-of-type so we match even if there are text nodes before it. */
    .mer-conference-detail
    .ui.bottom.tab.segment[data-tab="first"]
    > .ui.items:first-of-type {
      margin-top: 0 !important;
      padding-top: 0 !important;
    }

    /* 3) Tighten the first item/content block inside that list */
    .mer-conference-detail
    .ui.bottom.tab.segment[data-tab="first"]
    > .ui.items:first-of-type > .item:first-of-type {
      padding-top: 0 !important;
      margin-top: 0 !important;
    }

    .mer-conference-detail
    .ui.bottom.tab.segment[data-tab="first"]
    > .ui.items:first-of-type > .item:first-of-type > .content {
      padding-top: 0 !important;
      margin-top: 0 !important;
    }

    /* 4) Slightly tighten the "Conference Note" header itself */
    .mer-conference-detail
    .ui.bottom.tab.segment[data-tab="first"]
    .item:first-of-type .content > .header {
      margin-top: 0.15rem !important;
    }
  }

    @media (max-width: 768px) {
    .mer-agenda-mobile {
      padding: 0.75rem 1rem 1.25rem !important;
      margin-top: 0.25rem !important;
      background: #ffffff;
      border-radius: 8px;
      box-shadow: 0 4px 10px rgba(0,0,0,0.04);
    }

    .mer-agenda-mobile-text {
      margin: 0 0 0.5rem 0;
      font-size: 0.9rem;
      color: #4B5563;
    }

    .mer-agenda-mobile .ui.button {
      border-radius: 999px !important;
      font-weight: 600 !important;
    }
  }

  /* === Mobile: Venue Information card in Accommodations tab === */
  @media (max-width: 768px) {
    .mer-conference-detail .mer-venue-info-block {
      margin-top: 0.5rem !important;
      padding: 0.75rem 1rem 1rem !important;
      border-radius: 12px !important;
      box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
      border: 1px solid #E5E7EB;
      background: #ffffff;
    }

    .mer-conference-detail .mer-venue-info-block h4.header {
      margin-top: 0 !important;
      margin-bottom: 0.35rem !important;
      font-size: 1rem !important;
    }

    .mer-conference-detail .mer-venue-info-block .description {
      margin-top: 0.35rem !important;
      font-size: 0.9rem !important;
      line-height: 1.4;
    }

    .mer-conference-detail .mer-venue-info-block .meta {
      margin-top: 0.3rem !important;
      font-size: 0.8rem !important;
      color: #6B7280;
    }

    /* Slight separator line between Venue Information and Hotel Reservation Information */
    .mer-conference-detail .mer-venue-info-block .ui.divider {
      margin-top: 0.4rem !important;
      margin-bottom: 0.4rem !important;
    }
  }
}

/* end @media max-768 */

/* ============================================
   DESKTOP: hide ALL mobile-only header elements
   ============================================ */
@media (min-width: 769px) {

  .mer-mobile-header,
  .mer-mobile-header-inner,
  .mer-mobile-header-actions,
  .mer-mobile-header-icons,
  .mer-mobile-user-dropdown,
  .mer-mobile-menu-toggle,
  .mer-mobile-welcome,
  .user-mobile-nav,
  .mer-mobile-user-link,
  .mer_mobile_only_flex {
    display: none !important;
  }

  .mer-mobile-only {
    display: none !important;
  }

  .mer-desktop-only {
    display: block !important;
  }
}

/* ============================================
   LOGIN PAGE STYLES
   ============================================ */
.mer-login-page-full {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 80vh;
  background-color: #f9f9f9;
  padding: 20px;
}

.mer-login-panel {
  background: #fff;
  padding: 40px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 500px;
}

.mer-login-header {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
}

.mer-login-logo {
  height: 50px;
  margin-right: 15px;
}

.mer-login-title {
  font-size: 24px;
  font-weight: bold;
  color: #333;
}

.mer-login-subtitle {
  color: #666;
  margin-bottom: 20px;
}

.mer-login-divider {
  border: 0;
  border-top: 1px solid #eee;
  margin: 20px 0;
}

.mer-login-form .field {
  margin-bottom: 15px;
}

.mer-login-form label {
  display: block;
  margin-bottom: 5px;
  font-weight: 600;
}

.mer-login-form input[type="text"],
.mer-login-form input[type="password"] {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.mer-password-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mer-reset-link {
  font-size: 0.9em;
  color: #0073aa;
}

.mer-login-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 30px;
}

.mer-register-button {
  font-size: 0.9em;
}

/* ============================================
   MY MER DROPDOWN — keep icons dark on white
   (applies on desktop + mobile)
   ============================================ */
.mer_add_dropdown_here .menu .item i.icon,
.mer-mobile-user-dropdown .menu .item i.icon {
  color: rgba(0, 0, 0, 0.85) !important;
}

@media (max-width: 768px) {

  /* Pull the title hero closer to the header on conference detail */
  .mer-conference-detail .single-mast {
    padding-top: 4px !important;
    padding-bottom: 8px !important;
  }

  /* Make sure the inner grid doesn't reintroduce top padding */
  .mer-conference-detail .single-mast>.ui.grid.container {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
  }

  /* Mobile hero column: no extra top margin */
  .mer-conference-detail .single-mast .sixteen.wide.column.mer-mobile-only {
    margin-top: 0 !important;
  }

  /* Divider immediately after the hero: keep it tight */
  .mer-conference-detail .single-mast+.ui.divider {
    margin-top: 6px !important;
    margin-bottom: 8px !important;
  }
}

/* ============================================
   CONFERENCE DETAIL – unified hero gallery (GLOBAL)
   ============================================ */
.mer-venue-gallery {
  width: 100%;
}

.mer-venue-hero {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
}

.mer-venue-hero-img {
  display: block;
  width: 100%;
  height: auto;
  cursor: pointer;
  /* tap to expand */
}

.mer-venue-thumbnails {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.mer-venue-thumb {
  border: none;
  padding: 0;
  background: transparent;
  flex: 0 0 auto;
  cursor: pointer;
  border-radius: 6px;
  overflow: hidden;
  opacity: 0.7;
}

.mer-venue-thumb img {
  display: block;
  width: 72px;
  height: 48px;
  object-fit: cover;
}

.mer-venue-thumb.is-active {
  opacity: 1;
  box-shadow: 0 0 0 2px #1b5fbf;
  /* MER blue ring */
}

/* Hide legacy slider grid on desktop for single conference pages */
body.page-template-page-single-conf-php .ui.middle.aligned.grid.mer-mobile-hidden {
  display: none !important;
}

/* CONFERENCE DETAIL – unified tabs (desktop + mobile) */
.mer-conference-detail .mer_tab_menu.menu {
  margin: 0.75rem 1rem 0.5rem !important;
  border-radius: 999px !important;
  overflow: hidden;
  border: 1px solid #E5E7EB !important;
  display: flex !important;
  padding: 0 !important;
}

.mer-conference-detail .mer_tab_menu.menu .item {
  flex: 1 1 50%;
  text-align: center;
  font-size: 0.9rem;
  padding: 0.6rem 0.4rem !important;
  border-radius: 0 !important;
  border: none !important;
  color: #4B5563 !important;
  background: #F9FAFB !important;
  white-space: normal !important;
  line-height: 1.2;
}

.mer-conference-detail .mer_tab_menu.menu .item + .item {
  border-left: 1px solid #E5E7EB !important;
}

.mer-conference-detail .mer_tab_menu.menu .item.active {
  background: #1678c2 !important;  /* MER blue */
  color: #ffffff !important;
  font-weight: 600 !important;
}

/* OVERRIDE: Mobile Venue Information card */
@media (max-width: 768px) {
  .mer-conference-detail .mer-venue-info-block {
    margin-top: 0.4rem !important;
    padding: 0.75rem 1rem 1rem !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
    border: 1px solid #E5E7EB;
    background: #ffffff;
  }

  .mer-conference-detail .mer-venue-info-block h4.header {
    margin-top: 0 !important;
    margin-bottom: 0.35rem !important;
    font-size: 1rem !important;
  }

  .mer-conference-detail .mer-venue-info-block .description {
    margin-top: 0.35rem !important;
    font-size: 0.9rem !important;
    line-height: 1.4;
  }

  .mer-conference-detail .mer-venue-info-block .meta {
    margin-top: 0.3rem !important;
    font-size: 0.8rem !important;
    color: #6B7280;
  }

  /* Slight separator between Venue Information and Hotel Reservation Information */
  .mer-conference-detail .mer-venue-info-block .ui.divider {
    margin-top: 0.4rem !important;
    margin-bottom: 0.4rem !important;
  }
}

/* ==== MOBILE: collapse extra white space above Venue Information card ==== */
@media (max-width: 768px) {

  /* Make the Conference Note items shrink to content height */
  .mer-conference-detail
  .ui.bottom.tab.segment[data-tab="first"],
  .mer-conference-detail
  .ui.bottom.tab.segment[data-tab="first"] > .ui.items,
  .mer-conference-detail
  .ui.bottom.tab.segment[data-tab="first"] > .ui.items > .item,
  .mer-conference-detail
  .ui.bottom.tab.segment[data-tab="first"] > .ui.items > .item > .content {
    height: auto !important;
    min-height: 0 !important;
    margin-top: 0 !important;
    padding-top: 0 !important;
    margin-bottom: 0.35rem !important;  /* small gap only */
  }

  /* Ensure the Venue Information block itself also has no forced height */
  .mer-conference-detail
  .ui.items.segment.mer-venue-info-block,
  .mer-conference-detail
  .ui.items.segment.mer-venue-info-block > .item,
  .mer-conference-detail
  .ui.items.segment.mer-venue-info-block > .item > .content {
    height: auto !important;
    min-height: 0 !important;
  }

  /* Tighten top spacing on the venue block */
  .mer-conference-detail
  .ui.items.segment.mer-venue-info-block {
    margin-top: 0.5rem !important;
    padding-top: 0.75rem !important;
  }
}
/* ============================================
   RESPONSIVE TABLES (Credits, etc.)
   ============================================ */
.mer-table-responsive {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
}

.mer-table-responsive table {
    width: 100%;
    min-width: 600px; /* Force scroll on small screens */
}

@media (max-width: 768px) {
    .mer-table-responsive table th,
    .mer-table-responsive table td {
        padding: 0.5em 0.6em !important;
        font-size: 0.9rem !important;
    }
    
    .mer-table-responsive .ui.header {
        font-size: 1.2rem !important;
        margin-top: 1rem !important;
    }
}
