/* ==========================================================================
   Polish layer — loads after styles.css and theme-v3.css.
   Keeps the existing warm orange/blue design and fixes the rough edges:
   content that stayed invisible, a tall wrapped mobile header, crowded top bar,
   missing fonts, weak focus states and small tap targets.
   ========================================================================== */

html { scroll-padding-top: 96px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
img { max-width: 100%; }

/* ---------- Scroll reveal: content is visible unless animation is ready ---------- */
.reveal, .reveal-stagger > * { opacity: 1; transform: none; }
html.reveal-ready .reveal { opacity: 0; transform: translateY(24px); }
html.reveal-ready .reveal.in-view { opacity: 1; transform: none; }
html.reveal-ready .reveal-stagger > * { opacity: 0; transform: translateY(20px); }
html.reveal-ready .reveal-stagger.in-view > * { animation: revealFade .6s ease forwards; }

/* ---------- Header ---------- */
.warm-site .topbar.reputation-topbar { flex-direction: row; flex-wrap: nowrap; align-items: center; justify-content: space-between; gap: 16px; }
.warm-site .reputation-brand { display: block; flex: none; line-height: 0; }
.warm-site .reputation-brand img { width: auto; height: 62px; background: transparent; border-radius: 0; box-shadow: none; padding: 0; }
.warm-site .topbar.reputation-topbar.is-scrolled { box-shadow: 0 10px 30px rgba(7, 18, 58, .09); }
.nav-toggle { width: 46px; height: 46px; border-radius: 12px; flex: none; }

/* ---------- Focus, taps, press feedback ---------- */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid #0616b8; outline-offset: 3px; border-radius: 10px;
}
.button, .nav-cta, .whatsapp-float { transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease; }
.button:active, .nav-cta:active, .whatsapp-float:active { transform: scale(.97); }
input, select, textarea { font-size: 1rem; }

/* Pictures that fail to load fall back to a brand tint instead of broken-image text */
.img-failed { visibility: hidden; }
figure:has(> .img-failed), .image-service-card:has(> .img-failed), .service-row-media:has(> .img-failed), .public-gallery-card:has(> .img-failed) {
  background: linear-gradient(135deg, #1b2a9a 0%, #0a1240 100%);
}

/* Form feedback */
.form-message { min-height: 1.4em; font-weight: 700; }
.form-message.is-error { color: #b4231a; }
.form-message.is-ok { color: #12703a; }
button[disabled], .button[disabled] { opacity: .65; cursor: progress; }

/* ---------- Phones ---------- */
@media (max-width: 760px) {
  .warm-site .topbar.reputation-topbar { min-height: 64px; padding: 8px 5vw; }
  .warm-site .reputation-brand img { height: 46px; }

  .utility-bar { justify-content: space-between; gap: 10px; padding: 7px 5vw; font-size: .78rem; flex-wrap: nowrap; }
  .utility-bar a { white-space: nowrap; }
  .utility-bar .utility-location { display: none; }

  .eyebrow, .split-hero-copy .eyebrow { font-size: .72rem; letter-spacing: .06em; padding: 7px 12px; }

  /* On phones the WhatsApp button becomes a small round icon so it never covers text */
  .warm-site .whatsapp-float, .whatsapp-float {
    right: 14px; bottom: calc(14px + env(safe-area-inset-bottom));
    width: 54px; height: 54px; min-width: 54px; min-height: 54px; padding: 0; font-size: 0;
    background: #25d366 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M12 2a10 10 0 0 0-8.6 15.1L2 22l5-1.3A10 10 0 1 0 12 2zm0 2a8 8 0 1 1-4.2 14.8l-.4-.2-2.600.7.700-2.500-.3-.4A8 8 0 0 1 12 4zm-3 3.500c-.3 0-.6.200-.8.500-.5.700-.9 1.500-.2 2.800 1 1.800 2.300 3 4.200 3.900 1.100.5 1.800.4 2.400.1.5-.3 1-.9 1.100-1.400 0-.2-.1-.3-.3-.4l-1.500-.7c-.2-.1-.4 0-.5.100l-.6.700c-.1.100-.3.200-.5.100-1-.4-1.900-1.200-2.400-2.100-.1-.2 0-.3.100-.5l.4-.5c.1-.2.100-.3 0-.5l-.6-1.500c-.1-.3-.3-.4-.5-.4z'/%3E%3C/svg%3E") center / 28px no-repeat;
  }
  input, select, textarea { min-height: 48px; }
  .button { min-height: 48px; }
}
@media (max-width: 400px) {
  .utility-bar a:nth-child(2) { display: none; } /* email lives in the footer and contact page */
  .utility-bar { justify-content: flex-start; }
}

/* ---------- Large screens ---------- */
@media (min-width: 1600px) {
  .warm-site .topbar.reputation-topbar, .utility-bar { padding-left: max(6vw, calc((100vw - 1480px) / 2)); padding-right: max(6vw, calc((100vw - 1480px) / 2)); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-marquee, .hero-marquee * { animation: none !important; }
  .reveal, .reveal-stagger > * { opacity: 1 !important; transform: none !important; animation: none !important; }
}

/* Long emails/addresses must wrap instead of pushing the page sideways */
.contact-card-list, .contact-card-item { min-width: 0; }
.contact-card-item span, .contact-card-item strong, .contact-card-item small, .footer a, .warm-footer a { overflow-wrap: anywhere; }
