/*
 * GemReserve public shell repairs.
 *
 * These overrides intentionally load after the theme. They correct structural
 * responsive defects without changing page content or the theme templates.
 */

/* Keep every public hero truly full bleed. */
.hero {
  width: 100vw;
  max-width: none;
  margin-inline: calc(50% - 50vw);
}

.hero__media,
.hero__picture,
.hero__image {
  width: 100%;
  max-width: none;
}

.hero__picture,
.hero__image {
  height: 100%;
}

/* Give the hero message the same edge-to-edge rhythm as the media on wide
 * screens. The copy remains readable and does not spill over focal artwork. */
@media (min-width: 1400px) {
  .hero__inner {
    width: min(calc(100% - 96px), 1640px);
    max-width: none;
  }

  .hero__copy {
    max-width: 700px;
  }

  .hero__description {
    max-width: 58ch;
  }
}

/* Governance uses a source photograph with a large black field baked into its
 * left side. On ultra-wide screens that field, the theme scrim, and the shared
 * 1640px content cap combine to make the hero look only partially filled.
 * Zoom the photograph from its right edge, soften only this page's scrim, and
 * let its message use the full viewport rhythm without widening the text. */
@media (min-width: 761px) {
  .governance-hero__scrim {
    background:
      linear-gradient(
        90deg,
        rgb(1 5 8 / 82%) 0%,
        rgb(1 5 8 / 58%) 28%,
        rgb(1 5 8 / 16%) 56%,
        transparent 80%
      ),
      linear-gradient(0deg, rgb(1 5 8 / 48%), transparent 32%);
  }
}

@media (min-width: 2000px) {
  .governance-hero .hero__picture {
    transform: scale(1.22);
    transform-origin: 100% 50%;
  }
}

@media (min-width: 1400px) {
  .governance-hero__inner {
    width: calc(100% - 96px);
    max-width: none;
  }
}

body.gr-navigation-open {
  overflow: hidden;
}

/* Leadership belongs in the page flow, not beside Governance Structure as a
 * second grid cell. Stacking the panels removes the matched-height void. */
.governance-detail {
  grid-template-columns: minmax(0, 1fr) !important;
}

.governance-detail > .governance-card,
.governance-detail > .gr-leadership {
  grid-column: 1 / -1;
  width: 100%;
  min-width: 0;
}

/* Use the site's existing accessible drawer before the full navigation labels
 * and CTA begin colliding on laptops and reduced-width desktop windows. */
@media (max-width: 1800px) {
  .site-nav-shell {
    grid-template-columns: minmax(200px, 1fr) auto auto !important;
  }

  .desktop-nav {
    display: none !important;
  }

  .mobile-menu-trigger {
    display: flex !important;
  }

  .mobile-navigation {
    position: fixed !important;
    inset: 0 !important;
    bottom: auto !important;
    z-index: 120;
    display: block !important;
    width: 100vw !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    overflow: hidden;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition:
      visibility 260ms,
      opacity 220ms ease;
  }

  body.admin-bar .mobile-navigation {
    height: calc(100dvh - 32px) !important;
    max-height: calc(100dvh - 32px) !important;
  }

  .mobile-navigation.is-open {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-navigation-backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    background: rgb(0 2 4 / 76%);
    backdrop-filter: blur(8px);
  }

  .mobile-navigation-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: auto;
    width: min(460px, 92vw);
    height: 100%;
    max-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 20px 24px 34px;
    border-left: 1px solid var(--border);
    background:
      radial-gradient(
        circle at 100% 0%,
        rgb(42 110 106 / 16%),
        transparent 24rem
      ),
      #031016;
    box-shadow: -24px 0 70px rgb(0 0 0 / 55%);
    transform: translateX(104%);
    transition: transform 340ms var(--ease-premium);
  }

  .mobile-navigation.is-open .mobile-navigation-panel {
    transform: translateX(0);
  }

  .mobile-navigation-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-soft);
  }

  .mobile-navigation-header button {
    display: grid;
    width: 46px;
    height: 46px;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: transparent;
    color: var(--gold-light);
    font-size: 1.7rem;
    line-height: 1;
  }

  .mobile-navigation nav {
    padding-block: 14px;
  }

  .mobile-navigation details {
    border-bottom: 1px solid var(--border-soft);
  }

  .mobile-navigation summary {
    min-height: 52px;
    padding: 14px 2px;
    color: var(--ivory);
    font-family: var(--font-display), Georgia, serif;
    font-size: 1.13rem;
    list-style-position: outside;
  }

  .mobile-navigation details[open] summary {
    color: var(--gold-light);
  }

  .mobile-navigation ul {
    display: grid;
    gap: 2px;
    margin: 0;
    padding: 0 0 14px 14px;
    list-style: none;
  }

  .mobile-navigation li a,
  .mobile-navigation li > span {
    display: flex;
    min-height: 44px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 12px;
    border-radius: 4px;
    color: #c8ced0;
    font-size: 0.9rem;
  }

  .mobile-navigation li a:hover,
  .mobile-navigation li a:focus-visible {
    background: rgb(216 154 39 / 9%);
    color: var(--gold-light);
  }

  .mobile-navigation li > span {
    color: #758086;
  }

  .mobile-navigation-cta {
    width: 100%;
  }
}

@media (max-width: 782px) {
  body.admin-bar .mobile-navigation {
    height: calc(100dvh - 46px) !important;
    max-height: calc(100dvh - 46px) !important;
  }
}

/* The requested mobile behavior is edge-to-edge cover, without side bands. */
@media (max-width: 760px) {
  .hero__image {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center center;
  }
}
