/* Phone and tablet fixes, loaded last on every page (responsive review, October 2026). */

/* Anything marked hidden stays hidden, whatever a component's display rule says. */
[hidden] { display: none !important; }

/* iPhone zooms into any field with text under 16px; keep form text at 16px on small screens. */
@media (max-width: 900px) {
  input, select, textarea { font-size: 16px !important; }
}

@media (max-width: 1050px) {
  /* Homepage header: seal and name on the left, menu on the right. */
  body:not(.registry-page) .header-inner { justify-content: space-between; }
}

@media (max-width: 700px) {
  /* Homepage hero: the whole portrait across the top (the plaque, the books,
     the nameplate and the medal all show), then the proclamation beneath it. */
  .hero { min-height: 0; display: flex; flex-direction: column; }
  .hero-portrait {
    position: relative; inset: auto; order: -1; flex-shrink: 0;
    width: 100%; aspect-ratio: 3 / 2;
    background-size: cover; background-position: center; opacity: 1;
  }
  .hero-portrait::after {
    content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 26%;
    background: linear-gradient(0deg, #0d1b2c 0%, rgba(13, 27, 44, 0) 100%);
  }
  .hero-shade { display: none; }
  .hero-inner { min-height: 0; align-items: flex-start; }
  .hero-copy { padding: 18px 0 36px; }
  .hero-kicker { margin-bottom: 14px; }

  /* The motto stays on two balanced lines. */
  .closing-band p { text-wrap: balance; }

  /* Leave room so the floating hotline button never covers the footer's last lines. */
  .site-footer { padding-bottom: 96px; }
}

/* Inner pages: one menu everywhere; on phones and tablets it folds behind the button (nav.js). */
.registry-top-nav a { white-space: nowrap; }
@media (min-width: 1051px) and (max-width: 1250px) { .registry-top-nav { gap: 16px; } }
@media (max-width: 1050px) {
  .registry-page .site-header .header-inner { flex-wrap: nowrap; justify-content: space-between; gap: 10px; padding: 0; }
  .registry-page .inner-menu-toggle { margin-left: auto; }
  .registry-page .registry-top-nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%; z-index: 40; width: auto; margin: 0;
    flex-direction: column; align-items: stretch; gap: 0; padding: 12px 27px 20px;
    background: var(--ivory); border-top: 1px solid #ddd4c6; border-bottom: 1px solid #ddd4c6;
  }
  .registry-page .registry-top-nav.open { display: flex; }
  .registry-page .registry-top-nav a { display: block !important; font-size: 12px !important; padding: 13px 12px; }
  .registry-page .registry-top-nav a[aria-current=page] { border-bottom: 0; padding-bottom: 13px; color: var(--gold-deep); }
  .registry-page .registry-top-nav .registry-nav-appeal { margin-top: 8px; text-align: center; padding: 15px 12px !important; }
}

/* Phones: nothing smaller than 9px, and links big enough for a thumb. */
@media (max-width: 700px) {
  .brand-motto { font-size: 8px; letter-spacing: .12em; }
  .career-banner-intro span:last-child, .career-banner-grid span, .home-sample-top span,
  .image-plate, .paper-topline, .paper-footer, .closing-band span, .footer-brand small,
  .ledger-stat-grid span:not(.ledger-stat-num), .match-meta-label, .legacy-ledger-numbers span { font-size: 9px !important; }
  .footer-top nav { gap: 2px 18px; }
  .footer-top nav a { display: inline-block; padding: 8px 0; }
  .text-link, .plain-link, .cal-result, .inline-link, .faq-index a, .hotline-footer-link { position: relative; }
  .text-link::before, .plain-link::before, .cal-result::before, .faq-index a::before {
    content: ''; position: absolute; inset: -12px -6px;
  }
}

/* Inner-page title banners: shorter on phones so the page's purpose is on the first screen. */
@media (max-width: 700px) {
  .ledger-hero-inner { min-height: 0 !important; padding: 34px 0 30px !important; }
  .ledger-hero h1 { font-size: clamp(38px, 11vw, 48px); margin: 12px 0 16px; }
  .ledger-hero p:not(.eyebrow) { font-size: 19px; }
  .ledger-hero .ledger-rule { font-size: 17px !important; }
  /* Certificates: the certificate and its Send button first, the form beneath. */
  .cert-preview { order: -1; }
  .cert-workspace { padding-top: 24px; }
  .cert-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .cert-actions #cert-share { grid-column: 1 / -1; padding: 18px; }
  .case-actions, .letter-nav { display: grid; grid-template-columns: 1fr; gap: 10px; }
  .case-actions .button { width: 100%; }
}
