/*
 * GIU Connect Social 2.2.57 — final responsive and motion hardening.
 * Loaded after the legacy theme and navy/gold refresh styles so that the
 * mobile header, bottom navigation and safe-area rules have one final owner.
 */
:root {
  --giucs-mobile-nav-height: 68px;
  --giucs-mobile-header-height: 66px;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 84px;
  scroll-padding-bottom: calc(var(--giucs-mobile-nav-height) + env(safe-area-inset-bottom));
}

body {
  max-width: 100%;
  overflow-x: clip;
  -webkit-tap-highlight-color: transparent;
}

.giucs-app,
.giucs-app-body,
.giucs-r03-content,
#giucs-main {
  min-width: 0;
  max-width: 100%;
}

.giucs-app-body,
.giucs-r03-content {
  width: 100%;
}

.giucs-r03-content > * {
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
}

.giucs-r03-content :where(img, video, canvas, iframe, embed, object) {
  max-width: 100%;
}

.giucs-r03-content :where(input, select, textarea) {
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
}

.giucs-r03-content :where(pre, code) {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.giucs-r03-content pre {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.giucs-r03-content table {
  max-width: 100%;
}

.giucs-r03-content :where(button, input[type="button"], input[type="submit"], input[type="reset"], .button) {
  touch-action: manipulation;
}

.giucs-app-topbar :where(input, button, a),
.giucs-mobile-nav :where(a, summary) {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* Smooth page entry and consistent focus visibility without changing layout. */
.giucs-r03-content {
  animation: giucs-content-arrive .32s cubic-bezier(.2,.7,.2,1) both;
}

@keyframes giucs-content-arrive {
  from { opacity: .88; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

.giucs-app-topbar :where(input, button, a):focus-visible,
.giucs-r03-content :where(a, button, input, select, textarea, summary):focus-visible,
.giucs-mobile-nav :where(a, summary):focus-visible {
  outline: 3px solid rgba(224, 188, 67, .82);
  outline-offset: 2px;
}

@media (hover: hover) and (pointer: fine) {
  .giucs-r03-content :where(.giucs-feed-card, .giu-social-feed-card, .giucs-campus-post, .giucs-r04-event-card, .giucs-r06-card, .giucs-r19-card, .giucs-page-card, .giucs-widget) {
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  }
  .giucs-r03-content :where(.giucs-feed-card, .giu-social-feed-card, .giucs-campus-post, .giucs-r04-event-card, .giucs-r06-card, .giucs-r19-card, .giucs-page-card, .giucs-widget):hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 34px rgba(12, 25, 48, .10);
  }
  .giucs-r03-content :where(button, .button, input[type="submit"]):hover {
    filter: brightness(1.035);
  }
}

.giucs-r03-content :where(button, .button, input[type="submit"]):active {
  transform: translateY(1px) scale(.99);
}

/* Mobile and narrow phone landscape shell. */
@media (max-width: 800px), (min-width: 801px) and (max-width: 960px) and (max-height: 520px) {
  .giucs-app {
    display: block !important;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
  }

  .giucs-sidebar {
    display: none !important;
  }

  .giucs-app-topbar {
    display: grid !important;
    grid-template-columns: 38px minmax(0, 1fr) 42px auto;
    grid-template-areas: "brand search notifications story";
    align-items: center;
    justify-content: stretch;
    gap: 8px !important;
    width: 100%;
    min-width: 0;
    min-height: var(--giucs-mobile-header-height);
    height: auto !important;
    padding: max(8px, env(safe-area-inset-top)) 12px 8px !important;
    position: sticky;
    top: 0;
    z-index: 10050 !important;
    box-sizing: border-box;
  }

  .giucs-mobile-brand {
    grid-area: brand;
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 38px;
    min-width: 38px;
    height: 42px;
    margin: 0;
  }

  .giucs-mobile-brand .giucs-logo {
    display: block;
    width: 38px;
    height: 38px;
    max-width: 38px;
    max-height: 38px;
    object-fit: contain;
  }

  .giucs-app-topbar .giucs-app-name {
    display: none !important;
  }

  .giucs-app-topbar > form[role="search"] {
    grid-area: search;
    display: block;
    flex: none !important;
    width: 100%;
    min-width: 0 !important;
    max-width: none !important;
    margin: 0;
  }

  .giucs-app-topbar > form[role="search"] input[type="search"] {
    display: block;
    width: 100%;
    min-width: 0;
    min-height: 42px;
    height: 42px;
    box-sizing: border-box;
    padding: 9px 12px;
    font-size: 16px !important; /* Prevents iOS Safari focus zoom. */
    line-height: 1.3;
  }

  .giucs-app-topbar .giu-notifications-dropdown {
    grid-area: notifications;
    justify-self: end;
    min-width: 0;
    z-index: 10060;
  }

  .giucs-app-topbar .giu-notifications-dropdown-toggle,
  .giucs-app-topbar > a.giucs-top-notifications {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 42px !important;
    min-width: 42px !important;
    height: 42px !important;
    min-height: 42px !important;
    max-height: 42px !important;
    padding: 0 !important;
    box-sizing: border-box;
  }

  .giucs-app-topbar > a.giucs-top-notifications {
    grid-area: notifications;
    justify-self: end;
  }

  .giucs-app-topbar > a.giucs-top-story {
    grid-area: story;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    justify-self: end;
    min-width: 42px;
    width: auto;
    height: 42px !important;
    min-height: 42px !important;
    max-height: 42px !important;
    padding: 0 11px !important;
    gap: 7px !important;
    box-sizing: border-box;
    white-space: nowrap;
  }

  .giucs-app-topbar > a.giucs-top-story .giucs-top-story-symbol svg {
    width: 20px;
    height: 20px;
  }

  .giucs-app-topbar > a.giucs-top-story .giucs-top-story-text {
    font-size: 12px !important;
    line-height: 1 !important;
    white-space: nowrap;
  }

  .giucs-mobile-nav {
    position: fixed !important;
    inset: auto 0 0 0 !important;
    top: auto !important;
    z-index: 10040 !important;
    display: flex !important;
    flex-flow: row nowrap;
    align-items: stretch;
    justify-content: space-around;
    gap: 2px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: calc(var(--giucs-mobile-nav-height) + env(safe-area-inset-bottom));
    padding: 6px max(6px, env(safe-area-inset-left)) calc(6px + env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-right));
    box-sizing: border-box;
    overflow: visible !important;
    isolation: isolate;
    background: #10192f !important;
    border-top: 1px solid rgba(255, 255, 255, .13) !important;
    box-shadow: 0 -8px 28px rgba(8, 15, 29, .18);
  }

  .giucs-mobile-nav > a,
  .giucs-mobile-nav > .giucs-mobile-more {
    display: flex !important;
    flex: 1 1 0;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 52px;
    padding: 3px 1px;
    box-sizing: border-box;
  }

  .giucs-mobile-nav > a {
    flex-direction: column;
    gap: 4px;
    color: #f7f8fc !important;
    text-decoration: none;
    text-align: center;
    border-radius: 12px;
    transition: color .18s ease, background .18s ease, transform .18s ease;
  }

  .giucs-mobile-nav .giucs-mobile-nav-icon,
  .giucs-mobile-more > summary .giucs-mobile-more-icon {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    color: inherit !important;
  }

  .giucs-mobile-nav .giucs-mobile-nav-icon svg,
  .giucs-mobile-more > summary .giucs-mobile-more-icon svg {
    display: block;
    width: 22px;
    height: 22px;
  }

  .giucs-mobile-nav a small,
  .giucs-mobile-more > summary small {
    display: block;
    max-width: 100%;
    margin: 0;
    color: inherit !important;
    font-size: 10px !important;
    font-weight: 700;
    line-height: 1.12;
    text-align: center;
    white-space: normal !important;
    overflow-wrap: anywhere;
  }

  .giucs-mobile-nav > a.is-active,
  .giucs-mobile-nav > a[aria-current="page"] {
    color: #f1d36c !important;
    background: rgba(241, 211, 108, .10);
  }

  .giucs-mobile-nav > a:active {
    transform: scale(.96);
  }

  .giucs-mobile-more {
    position: static !important;
    z-index: auto !important;
  }

  .giucs-mobile-more > summary {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 100%;
    min-width: 0;
    min-height: 52px;
    padding: 3px 1px;
    color: #f1d36c !important;
    text-align: center;
    list-style: none;
    cursor: pointer;
    border-radius: 12px;
  }

  .giucs-mobile-more > summary::-webkit-details-marker {
    display: none !important;
  }

  /* No summary pseudo-backdrop: it used to stack above and intercept menu taps. */
  .giucs-mobile-more[open] > summary::before {
    content: none !important;
    display: none !important;
  }

  .giucs-mobile-more-panel {
    position: fixed !important;
    inset: auto 10px calc(var(--giucs-mobile-nav-height) + 10px + env(safe-area-inset-bottom)) 10px !important;
    width: auto !important;
    max-width: 420px !important;
    max-height: min(64vh, 560px) !important;
    max-height: min(64dvh, 560px) !important;
    margin: 0 auto !important;
    padding: 10px !important;
    box-sizing: border-box !important;
    display: none;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-auto-flow: row;
    gap: 7px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    background: #10192f !important;
    border: 1px solid #34415b !important;
    border-radius: 18px !important;
    box-shadow: 0 18px 48px rgba(5, 10, 22, .38) !important;
    z-index: 10060 !important;
  }

  .giucs-mobile-more[open] > .giucs-mobile-more-panel {
    display: grid !important;
  }

  .giucs-mobile-more-panel a,
  .giucs-mobile-more-panel a:visited {
    display: flex !important;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-width: 0;
    min-height: 48px;
    height: auto;
    margin: 0;
    padding: 11px 13px;
    box-sizing: border-box;
    border: 1px solid #2d3b56;
    border-radius: 12px;
    background: #1a2740 !important;
    color: #fff !important;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.35;
    text-align: left;
    text-decoration: none;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .giucs-mobile-more-panel a > span:not(.giucs-mobile-more-link-icon) {
    flex: 1 1 auto;
    min-width: 0;
    color: inherit !important;
    overflow-wrap: anywhere;
  }

  .giucs-mobile-more-panel .giucs-mobile-more-link-icon,
  .giucs-mobile-more-panel .giucs-mobile-more-link-icon svg {
    display: inline-flex;
    flex: 0 0 24px;
    align-items: center;
    justify-content: center;
    width: 24px;
    min-width: 24px;
    height: 24px;
    color: #fff !important;
    stroke: currentColor;
  }

  .giucs-mobile-more-panel a:active,
  .giucs-mobile-more-panel a:focus-visible {
    background: #dfba3f !important;
    border-color: #dfba3f !important;
    color: #121b2f !important;
  }

  .giucs-r03-content {
    padding-bottom: max(100px, calc(82px + env(safe-area-inset-bottom))) !important;
  }

  .giucs-r03-content :where(table) {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .giucs-r03-content :where(.giucs-r22-tabs, .giucs-r04-media-actions, .giucs-r07-filters) {
    max-width: 100%;
  }

  .giucs-r03-content .giucs-r22-tabs {
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .giucs-r03-content .giucs-r22-tabs::-webkit-scrollbar {
    display: none;
  }

  .giucs-r03-content .giucs-r04-media-actions,
  .giucs-r03-content .giucs-r07-filters {
    flex-wrap: wrap;
  }

  .giucs-app-topbar .giu-notifications-dropdown-panel,
  .giucs-app-topbar .giu-notifications-dropdown-panel[hidden] {
    box-sizing: border-box;
  }

  .giucs-app-topbar .giu-notifications-dropdown-panel:not([hidden]) {
    position: fixed !important;
    top: calc(var(--giucs-mobile-header-height) + env(safe-area-inset-top) + 8px) !important;
    right: 10px !important;
    left: 10px !important;
    width: auto !important;
    max-width: 480px;
    max-height: calc(100dvh - var(--giucs-mobile-header-height) - 112px - env(safe-area-inset-top)) !important;
    margin: 0 auto;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    z-index: 10070 !important;
  }
}

@media (max-width: 480px) {
  .giucs-app-topbar {
    grid-template-columns: 36px minmax(0, 1fr) 40px auto;
    gap: 6px !important;
    padding-inline: 9px !important;
  }

  .giucs-mobile-brand,
  .giucs-mobile-brand .giucs-logo {
    width: 36px;
    min-width: 36px;
    max-width: 36px;
    height: 36px;
    max-height: 36px;
  }

  .giucs-app-topbar .giu-notifications-dropdown-toggle,
  .giucs-app-topbar > a.giucs-top-notifications {
    width: 40px !important;
    min-width: 40px !important;
    height: 40px !important;
    min-height: 40px !important;
  }

  .giucs-app-topbar > a.giucs-top-story {
    width: 40px;
    min-width: 40px;
    max-width: 40px;
    padding: 0 !important;
  }

  .giucs-app-topbar > a.giucs-top-story .giucs-top-story-text {
    display: none !important;
  }

  .giucs-app-topbar > a.giucs-top-story .giucs-top-story-symbol svg {
    width: 21px;
    height: 21px;
  }

  .giucs-app-topbar > form[role="search"] input[type="search"] {
    font-size: 16px !important;
    padding-inline: 10px;
  }

  .giucs-mobile-nav a small,
  .giucs-mobile-more > summary small {
    font-size: 9px !important;
  }

  .giucs-r03-content :where(button, input[type="button"], input[type="submit"], .button) {
    max-width: 100%;
    white-space: normal;
  }

  .giucs-campus-post-actions > * {
    min-width: 0;
    padding: 10px 5px;
    font-size: 12px;
  }
}

@media (max-width: 360px) {
  .giucs-app-topbar {
    grid-template-columns: 34px minmax(0, 1fr) 38px auto;
    gap: 5px !important;
    padding-inline: 7px !important;
  }

  .giucs-mobile-brand,
  .giucs-mobile-brand .giucs-logo {
    width: 34px;
    min-width: 34px;
    max-width: 34px;
    height: 34px;
    max-height: 34px;
  }

  .giucs-app-topbar .giu-notifications-dropdown-toggle,
  .giucs-app-topbar > a.giucs-top-notifications,
  .giucs-app-topbar > a.giucs-top-story {
    width: 38px !important;
    min-width: 38px !important;
    max-width: 38px;
    height: 38px !important;
    min-height: 38px !important;
    max-height: 38px !important;
  }

  .giucs-mobile-nav a small,
  .giucs-mobile-more > summary small {
    font-size: 9px !important;
  }
}

/* Small landscape phones otherwise fall into the desktop sidebar layout. */
@media (min-width: 801px) and (max-width: 960px) and (max-height: 520px) {
  .giucs-app-topbar .giucs-app-name { display: none !important; }
  .giucs-app-topbar { grid-template-columns: 38px minmax(0, 1fr) 42px auto; }
}

/* Scroll-reveal is opt-in from JS and skipped entirely for reduced-motion users. */
html.giucs-motion-ready .giu-motion-item {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .42s ease var(--giu-motion-delay, 0ms), transform .42s cubic-bezier(.2,.7,.2,1) var(--giu-motion-delay, 0ms);
  will-change: opacity, transform;
}

html.giucs-motion-ready .giu-motion-item.giu-motion-visible {
  opacity: 1;
  transform: translateY(0);
  will-change: auto;
}

@keyframes giucs-story-ring-breathe {
  0%, 100% { box-shadow: 0 0 0 0 rgba(224, 188, 67, .12); }
  50% { box-shadow: 0 0 0 5px rgba(224, 188, 67, .08); }
}

@keyframes giucs-notification-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(217, 75, 91, 0); }
  50% { box-shadow: 0 0 0 4px rgba(217, 75, 91, .16); }
}

@media (prefers-reduced-motion: no-preference) {
  .giucs-story-ring { animation: giucs-story-ring-breathe 3.8s ease-in-out infinite; }
  .giucs-app-topbar .giu-notifications-dropdown-count,
  .giucs-app-topbar .giucs-notification-count { animation: giucs-notification-pulse 2.8s ease-in-out infinite; }
}

@media (max-width: 800px) {
  body.giucs-mobile-keyboard-open .giucs-mobile-nav {
    transform: translateY(110%);
    pointer-events: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .giucs-r03-content { animation: none !important; }
  html.giucs-motion-ready .giu-motion-item,
  html.giucs-motion-ready .giu-motion-item.giu-motion-visible {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    will-change: auto !important;
  }
  .giucs-story-ring,
  .giucs-app-topbar .giu-notifications-dropdown-count,
  .giucs-app-topbar .giucs-notification-count {
    animation: none !important;
  }
  .giucs-mobile-nav,
  .giucs-mobile-nav > a,
  .giucs-r03-content :where(button, .button, input[type="submit"]) {
    transition: none !important;
  }
}


/* GIU Connect 2.2.58 — role-aware navigation and phone tab usability. */
@media (max-width: 800px), (min-width: 801px) and (max-width: 960px) and (max-height: 520px) {
  /* Student headers do not reserve an empty Add Story column. */
  .giucs-app-topbar.no-story {
    grid-template-columns: 38px minmax(0, 1fr) 42px !important;
    grid-template-areas: "brand search notifications" !important;
  }

  .giucs-mobile-more > summary.is-active {
    color: #f1d36c !important;
    background: rgba(241, 211, 108, .10);
  }

  .giucs-mobile-more-panel a.is-active,
  .giucs-mobile-more-panel a.is-active:visited {
    background: #dfba3f !important;
    border-color: #dfba3f !important;
    color: #121b2f !important;
  }

  .giucs-mobile-more-panel a.is-active .giucs-mobile-more-link-icon,
  .giucs-mobile-more-panel a.is-active .giucs-mobile-more-link-icon svg {
    color: #121b2f !important;
    stroke: currentColor;
  }

  /* Keep long workspace tab rows usable on narrow phones instead of wrapping
     or shrinking every tab until the labels become unreadable. */
  .giucs-r03-content .giucs-r22-tabs,
  .giucs-r03-content :where(.giu-tab-list, .giu-tabs, .giucs-tabs, [role="tablist"]) {
    display: flex !important;
    flex-flow: row nowrap !important;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    scroll-padding-inline: 16px;
  }

  .giucs-r03-content .giucs-r22-tabs::-webkit-scrollbar,
  .giucs-r03-content :where(.giu-tab-list, .giu-tabs, .giucs-tabs, [role="tablist"])::-webkit-scrollbar {
    display: none;
  }

  .giucs-r03-content .giucs-r22-tabs > a,
  .giucs-r03-content :where(.giu-tab-list, .giu-tabs, .giucs-tabs, [role="tablist"]) > :where(a, button, [role="tab"]) {
    display: inline-flex;
    flex: 0 0 auto !important;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    max-width: none;
    white-space: nowrap !important;
    overflow-wrap: normal;
  }

  .giucs-app,
  .giucs-app-body,
  .giucs-r03-content,
  .giucs-r22-workspace,
  .giucs-r22-grid {
    min-width: 0;
    max-width: 100%;
  }

  .giucs-r03-content :where(img, video, iframe, canvas) {
    max-width: 100%;
  }
}
