/* ============================================================
   URBANORTH — Responsive enhancements & mobile nav
   Layered on top of colors_and_type.css + site.css
   Breakpoints: 1200 (desktop ↓), 900 (tablet ↓), 600 (phone ↓)
   ============================================================ */

/* ---------- Mobile menu toggle button (hidden on desktop) ---------- */
.un-nav__toggle {
  display: none;
  background: transparent;
  border: 0;
  padding: 8px;
  cursor: pointer;
  color: var(--un-ink);
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
}
.un-nav__toggle svg {
  width: 24px;
  height: 24px;
  display: block;
}
.un-nav__toggle:focus-visible {
  outline: 1px solid var(--un-ink);
  outline-offset: 2px;
}

/* ---------- Mobile nav drawer ---------- */
.un-nav__drawer {
  display: none;
  position: fixed;
  inset: 64px 0 0 0;
  background: var(--un-paper);
  z-index: 9;
  padding: 32px clamp(20px, 4vw, 64px) 64px;
  flex-direction: column;
  gap: 0;
  overflow-y: auto;
  border-top: 1px solid var(--un-rule);
}
.un-nav__drawer.is-open { display: flex; }
.un-nav__drawer a {
  font-family: var(--un-serif);
  font-weight: 300;
  font-size: 32px;
  line-height: 1.2;
  color: var(--un-ink);
  border: 0;
  padding: 18px 0;
  border-bottom: 1px solid var(--un-rule);
  transition: color var(--un-dur-fast) var(--un-ease);
}
.un-nav__drawer a:hover,
.un-nav__drawer a.is-active { color: var(--un-accent); }
.un-nav__drawer .un-mono-label { margin-top: 32px; }
.un-nav__drawer .un-btn { align-self: flex-start; margin-top: 16px; }
body.has-drawer-open { overflow: hidden; }

/* ============================================================
   Tablet & phone — improvements over the 900px existing rule
   ============================================================ */

/* ---------- 1200px and below — slight tightening ---------- */
@media (max-width: 1200px) {
  .un-hero__inner { gap: 40px; }
  .un-services { gap: 40px 36px; }
  .un-projects-grid { gap: 24px; }
}

/* ---------- 900px and below — tablet ---------- */
@media (max-width: 900px) {
  /* Show hamburger, hide desktop links + EN/DK + button */
  .un-nav__toggle { display: inline-flex; }
  .un-nav__links,
  .un-nav__right { display: none; }
  .un-nav { padding: 18px clamp(20px, 4vw, 64px); }

  /* Hero: stacked, restrained */
  .un-hero { padding-top: 40px; padding-bottom: 56px; }
  .un-hero__inner { padding-bottom: 40px; }
  .un-hero__head h1 { font-size: clamp(44px, 9vw, 72px) !important; margin-top: 18px; }

  /* Sections: less padding */
  .un-section { padding: 56px 0; }
  .un-section--ink { padding: 72px 0; }

  /* Stats: 2x2 grid on tablet */
  .un-stats { grid-template-columns: repeat(2, 1fr); }
  .un-stat { padding: 22px 16px 22px 0; }
  .un-stat:nth-child(2) { border-right: 0; }
  .un-stat:nth-child(odd) { border-right: 1px solid var(--un-rule); }
  .un-stat:nth-child(-n+2) { border-bottom: 1px solid var(--un-rule); }
  .un-stat__num { font-size: 44px; }

  /* Services: 2 columns */
  .un-services { grid-template-columns: repeat(2, 1fr); gap: 32px; }
  .un-projects-grid,
  .un-projects-grid--3,
  .un-team-grid,
  .un-pillars,
  .un-footer__top { grid-template-columns: repeat(2, 1fr); }

  /* CTA band: stack */
  .un-cta-band { flex-direction: column; align-items: flex-start; }
  .un-cta-band h3 { font-size: 32px; }

  /* Approach process: stack */
  .un-process__row { grid-template-columns: 1fr; gap: 12px; padding: 28px 0; }

  /* Page heads */
  .un-page { padding: 40px 0 72px; }
  .un-page-head h1 { font-size: clamp(32px, 6vw, 56px); }
  .un-section-head h2 { font-size: clamp(28px, 5vw, 48px); }

  /* Footer */
  .un-footer { padding: 48px clamp(20px, 4vw, 64px) 24px; }
}

/* ---------- 600px and below — phone ---------- */
@media (max-width: 600px) {
  /* Stats: stack */
  .un-stats { grid-template-columns: 1fr; }
  .un-stat,
  .un-stat:nth-child(odd) { border-right: 0; border-bottom: 1px solid var(--un-rule); padding: 20px 0; }
  .un-stat:last-child { border-bottom: 0; }

  /* Services: stack */
  .un-services { grid-template-columns: 1fr; gap: 28px; }

  /* Project cards: stack */
  .un-projects-grid,
  .un-projects-grid--3 { grid-template-columns: 1fr; gap: 20px; }

  /* Pillars: stack */
  .un-pillars { grid-template-columns: 1fr; gap: 24px; }

  /* Footer: stack */
  .un-footer__top { grid-template-columns: 1fr; gap: 32px; padding-bottom: 24px; }
  .un-footer__bottom { flex-direction: column; align-items: flex-start; gap: 12px; }

  /* Team: stack 2x */
  .un-team-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }

  /* Hero: even tighter */
  .un-hero__head h1 { font-size: clamp(40px, 11vw, 60px) !important; }
  .un-hero { padding-top: 32px; padding-bottom: 40px; }

  /* Buttons: full-width on phones if in CTA group */
  .un-hero__ctas { flex-direction: column; align-items: stretch; gap: 14px; }
  .un-hero__ctas .un-btn { text-align: center; }

  /* Page heads */
  .un-page-head h1 { font-size: clamp(28px, 7vw, 44px); }
  .un-section { padding: 40px 0; }

  /* Mobile nav drawer: slightly smaller links */
  .un-nav__drawer a { font-size: 26px; padding: 16px 0; }

  /* Project detail: mobile */
  .un-project-detail__meta { grid-template-columns: 1fr; }
}

/* ---------- 380px and below — small phone ---------- */
@media (max-width: 380px) {
  .un-hero__head h1 { font-size: 36px !important; }
  .un-page-head h1 { font-size: 28px; }
  .un-stat__num { font-size: 36px; }
}

/* ---------- Hover-vs-touch differentiation ---------- */
@media (hover: none) {
  /* On touch devices, disable hover transforms to avoid sticky states */
  .un-project-card:hover { transform: none; box-shadow: none; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- Print ---------- */
@media print {
  .un-nav, .un-footer, .un-nav__toggle, .un-nav__drawer { display: none !important; }
  body { background: white; color: black; }
}
