/* Navigation and reading controls shared by the static pages. */
@media screen {
  #mobile-nav-panel > nav {
    padding-top: 0;
    overscroll-behavior-y: contain;
    scroll-padding-top: calc(5rem + env(safe-area-inset-top));
  }

  #mobile-nav-panel > nav > div:first-child {
    position: sticky;
    top: 0;
    z-index: 2;
    margin: 0 -1.25rem .5rem;
    padding: calc(.75rem + env(safe-area-inset-top)) 1.25rem .75rem;
    gap: .5rem;
    background: #071520;
    border-bottom: 1px solid #334754;
  }

  #mobile-nav-panel > nav > div:first-child > div:last-child {
    flex-shrink: 0;
  }

  #desktop-services-panel {
    max-height: calc(100vh - 5.5rem);
    max-height: calc(100dvh - 5.5rem);
    overflow-y: auto;
    overscroll-behavior-y: contain;
    scrollbar-color: #527281 #081722;
  }

  /* The route links are useful targets even when the breadcrumb fits on one line. */
  main nav:is([aria-label^='Ruta de navega'], [aria-label^='Fil d'], [aria-label='Breadcrumb']) a {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
  }

  main nav:is(.mb-6, .mb-8):is([aria-label^='Ruta de navega'], [aria-label^='Fil d'], [aria-label='Breadcrumb']) {
    flex-wrap: wrap;
    margin-bottom: 1rem;
    row-gap: 0;
  }

  /* Use the available column for long words in narrow cards. */
  main :where(h1, h2, h3) {
    overflow-wrap: break-word;
  }

  .glass-card.text-center:has(> .font-display.text-5xl) {
    container-type: inline-size;
  }
  .glass-card.text-center > .font-display.text-5xl {
    font-size: clamp(1.75rem, 14cqi, 3.75rem);
  }
}

@media screen and (max-width: 30rem) {
  #mobile-nav-panel > nav > div:first-child > div:first-child > p + p {
    display: none;
  }

  /* Titles inside a second inset have much less room than the viewport. */
  main .container-narrow > .rounded-3xl.p-7 {
    padding-inline: clamp(1rem, 5vw, 1.75rem);
  }

  main header[class*='BlogPostLayout_masthead'] nav {
    margin-bottom: 1rem;
  }
}

/* Article mastheads have a breadcrumb followed by the title and cover grid. */
@media screen and (min-width: 60rem) {
  main header[class*='BlogPostLayout_masthead'] {
    padding-block-start: clamp(6.25rem, 8vw, 7.5rem);
  }

  main header[class*='BlogPostLayout_masthead'] > div > nav {
    margin-bottom: clamp(1.25rem, 2.5vw, 2.5rem);
  }

  main header[class*='BlogPostLayout_masthead'] > div > nav + div > div:has(> h1) {
    align-self: start;
  }

  main header[class*='BlogPostLayout_masthead'] h1 {
    font-size: clamp(2.5rem, 4.2vw, 3.75rem);
    text-wrap: balance;
  }
}
