/* Brand strip: reduce height to ~80% of original without warping */
.ugp-brand-strip-img {
  max-height: 80px;
  width: auto;
  height: auto;
}

/* =========================================================
   UGP HOMEPAGE CARD TITLE FIX — place at VERY TOP of Additional CSS
   Purpose: neutralize the front-page inline #about .ugp-card-title rule
   and prevent inherited mobile centering from affecting homepage cards.
   ========================================================= */
#about .ugp-card-title,
#frontpage-announcements .ugp-card-title,
#programs .ugp-card-title,
#news-updates .ugp-card-title,
#academic-support-services .ugp-card-title {
  font-size: 1.1rem !important;
  line-height: 1.3 !important;
  text-align: left !important;
  margin: 0 0 0.5rem !important;
}

#about .ugp-about-card-media-row,
#about .ugp-about-card-content,
#frontpage-announcements .ugp-card-content-wrap,
#programs .ugp-card-content-wrap,
#news-updates .ugp-card-content-wrap,
#academic-support-services .ugp-support-card-content {
  text-align: left !important;
}



/* Make the main menu sit at the bottom of the header */
.ugp-header-inner {
  align-items: flex-end; /* brand + nav align on bottom edge */
}

/* Top bar: ~24px tall strip, with secondary menu inside */
.ugp-topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  min-height: 24px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

/* Secondary menu text small and compact */
.ugp-topbar-menu a {
  font-size: 0.75rem;
  line-height: 1;
  padding: 0.1rem 0.3rem;
}

/* Make header (brand strip + main menu) stick to top when scrolling */
.ugp-header-shell {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #00386f;
}

/* Center the secondary/topbar menu on mobile */
@media (max-width: 768px) {
  .ugp-topbar-inner {
    justify-content: center;
  }
  .ugp-topbar-menu {
    justify-content: center;
  }
}

/* Online Application form: make it compact and centered */
.page-template-page-online-application .wpcf7,
.page-template-page-online-application .wpcf7-form{
  max-width: 500px !important;
  margin: 0 auto !important;
}

/* Keep fields from looking stretched */
.page-template-page-online-application .wpcf7 input,
.page-template-page-online-application .wpcf7 select,
.page-template-page-online-application .wpcf7 textarea{
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box;
}

/* Optional: slightly tighter spacing between fields */
.page-template-page-online-application .wpcf7 form p{
  margin-bottom: 12px !important;
}

/* Make ugp-card title match form section headings */
#online-application-page .ugp-card-title{
  font-size: inherit;       /* reset any bigger card-title styling */
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 8px;
}

/* Force it to exactly equal the h3 section headings */
#online-application-page .ugp-card-title{
  font-size: clamp(1.05rem, 1rem + 0.3vw, 1.2rem) !important;
}

/* If your section headings are explicitly styled, mirror that */
#online-application-page .ugp-application-form h3{
  font-size: clamp(1.05rem, 1rem + 0.3vw, 1.2rem);
  font-weight: 600;
  line-height: 1.3;
}

@media print {
  /* General print cleanup */
  * {
    box-shadow: none !important;
    text-shadow: none !important;
  }

  body {
    background: #ffffff !important;
    color: #000000 !important;
    margin: 0;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* Hide site chrome: header, top bar, footer, print button */
  .ugp-header-shell,
  .ugp-topbar,
  .ugp-footer {
    display: none !important;
  }


  /* Don’t print raw URLs after links */
  a[href]:after {
    content: "" !important;
  }
}

@page {
  margin: 0;
  size: auto;
}

@media print {

  /* Remove browser-generated headers and footers */
  @page {
    margin-top: 0;
    margin-bottom: 0;
  }

  /* WebKit-specific fix (Chrome, Edge, Safari) */
  body {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* Remove Chrome/Edge/Safari print header/footer completely */
  body::before,
  body::after {
    display: none !important;
    content: "" !important;
  }
}

/* Add 5px padding above and below the brand strip */
.ugp-brand-strip {
  padding-top: 5px !important;
  padding-bottom: 5px !important;
}

/* MOBILE ONLY: vertically center the hamburger menu */
@media (max-width: 960px) {
  .ugp-nav-toggle,
  .ugp-mobile-toggle {
    display: flex !important;
    align-items: center !important;
    height: 100%;
  }

  .ugp-header-inner {
    display: flex;
    align-items: center !important;
  }
}

/* DESKTOP: hide hamburger toggle */
@media (min-width: 961px) {
  .ugp-nav-toggle,
  .ugp-mobile-toggle {
    display: none !important;
  }
}

/* Mobile: fluidly scale secondary menu item text */
@media (max-width: 768px) {

  #menu-secondary-menu a {
    font-size: clamp(10px, 3.5vw, 15px) !important;
    line-height: 1.2;
    white-space: nowrap; /* prevents wrapping */
  }

  /* Remove any extra padding so scaling works cleanly */
  #menu-secondary-menu,
  #menu-secondary-menu li {
    padding: 0 !important;
    margin: 0 !important;
  }

  /* Optional: tighten spacing between menu items */
  #menu-secondary-menu li a {
    padding-left: 6px !important;
    padding-right: 6px !important;
  }
}


/* =========================================================================
   UPDATED SAFARI STICKY HITBOX & MENU FIXES (DESKTOP & MOBILE SPLIT)
   ========================================================================= */

/* The header shell can stick, but without the translateZ flat-layer trap */
.ugp-header-shell {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 99990 !important;
    /* REMOVED: transform: translateZ(0); - this was destroying mobile menus */
}

/* Safely prevent ghost clicks via touch-action instead of pointer-events */
.ugp-header-shell button,
.ugp-header-shell a {
    touch-action: manipulation;
}

/* DESKTOP ONLY: Safari Hitbox Hacks
  (We keep this out of mobile so it doesn't block screen taps on the menu)
*/
@media (min-width: 961px) {
    .ugp-header {
        pointer-events: none;
    }
    .ugp-header-inner > *,
    .ugp-nav-primary-wrapper,
    .ugp-nav-primary {
        pointer-events: auto !important;
    }
    .ugp-header-navcluster {
        position: relative;
        z-index: 1010;
        pointer-events: auto !important;
    }
}

/* MOBILE ONLY: Release the Nav Cluster Anchor Trap
*/
@media (max-width: 960px) {
    /* Fix for Safari flex-end bug: ensure the nav has a defined height */
    .ugp-nav-primary-wrapper {
        display: block;
        min-height: 44px;
    }

    .ugp-nav-primary.open {
        z-index: 999999 !important;
        display: flex !important;
        -webkit-appearance: none;
    }

    /* Crucial: Pull the menu anchor out of the tiny icon cluster */
    .ugp-header-navcluster {
        position: static !important;
    }
}

/* =========================================================================
   ULTIMATE FIX: MOBILE MENU STACKING & SAFARI RENDER HACKS
   ========================================================================= */
@media (max-width: 960px) {
    /* 1. Explicitly trap the entire main content's z-index so the hero
          slider transitions cannot break out and overlap the header. */
    #ugp-main-content {
        position: relative !important;
        z-index: 1 !important;
        isolation: isolate !important;
    }

    /* 2. Ensure the sticky header has the maximum baseline z-index */
    .ugp-header-shell {
        z-index: 999999 !important;
    }

    /* 3. Force the mobile browser's graphics hardware to pull the open
          menu forward into 3D space, completely bypassing the 2D layout bugs. */
    .ugp-nav-primary.open {
        z-index: 9999999 !important;
        -webkit-transform: translate3d(0, 0, 100px) !important;
        transform: translate3d(0, 0, 100px) !important;
    }
}
