﻿/*
  COMPASS shared interface polish
  Purpose: consistent public web + future mobile-app feel across linked pages.
  This file enhances existing page styles without replacing them.
*/

:root {
  --compass-radius-soft: 18px;
  --compass-radius-card: 30px;
  --compass-focus: rgba(201, 164, 92, 0.55);
  --compass-tap-min: 44px;
}

/* Smooth page movement for anchor links */
html {
  scroll-behavior: smooth;
}

/* Better reading rhythm and mobile rendering */
body {
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* Consistent focus visibility for keyboard and accessibility users */
a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--compass-focus);
  outline-offset: 4px;
  border-radius: 12px;
}

/* Navigation consistency across public pages */
nav a {
  min-height: var(--compass-tap-min);
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 2px;
}

/* Make key interactive elements feel more app-like */
.actions a,
summary {
  -webkit-tap-highlight-color: transparent;
}

/* Folded guidance consistency */
details.folded {
  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

details.folded[open] {
  box-shadow: 0 14px 34px rgba(22, 35, 63, 0.08);
}

details.folded summary {
  min-height: var(--compass-tap-min);
  display: flex;
  align-items: center;
  gap: 10px;
  list-style-position: outside;
}

details.folded summary::marker {
  color: currentColor;
}

/* Card rhythm consistency */
.card,
.map-card {
  overflow-wrap: anywhere;
}

/* Media should never overflow future profile/map pages */
img,
svg,
video,
canvas {
  max-width: 100%;
  height: auto;
}

/* Consistent internal anchor spacing below sticky headers */
section[id],
h1[id],
h2[id],
h3[id] {
  scroll-margin-top: 110px;
}

/* Mobile interface refinement */
@media (max-width: 880px) {
  header {
    gap: 16px;
  }

  nav {
    width: 100%;
    gap: 8px 12px;
  }

  nav a {
    padding: 6px 0;
  }

  .actions {
    gap: 10px;
  }

  .actions a {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .card,
  .map-card,
  .deep {
    border-radius: 24px;
  }

  details.folded {
    border-radius: 16px;
  }
}

/* Small-phone comfort */
@media (max-width: 520px) {
  h1 {
    letter-spacing: -0.04em;
  }

  p,
  li {
    font-size: 1rem;
  }

  .hero p {
    font-size: 1.08rem;
  }

  .card,
  .map-card,
  .deep {
    padding: 22px;
  }
}

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* Calm pathway / breadcrumb-style orientation */
.compass-path {
  max-width: 1120px;
  margin: 0 auto 22px;
  padding: 0 20px;
  font-size: 0.84rem;
  color: rgba(57, 45, 35, 0.68);
}

.compass-path span {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.compass-path a,
.compass-path strong {
  color: inherit;
  text-decoration: none;
}

.compass-path a {
  border-bottom: 1px solid rgba(57, 45, 35, 0.18);
}

.compass-path a:hover {
  border-bottom-color: rgba(57, 45, 35, 0.42);
}

.compass-path strong,
.compass-path [aria-current="page"] {
  color: rgba(57, 45, 35, 0.92);
  font-weight: 700;
}

.compass-path .separator {
  color: rgba(57, 45, 35, 0.34);
}

@media (max-width: 640px) {
  .compass-path {
    margin-bottom: 16px;
    font-size: 0.8rem;
  }
}

/* Typography and visual coherence refinement */
:root {
  --compass-font-ui: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --compass-font-reading: Georgia, "Times New Roman", serif;
  --compass-text-strong: rgba(41, 34, 27, 0.94);
  --compass-text-soft: rgba(57, 45, 35, 0.72);
  --compass-line-soft: rgba(57, 45, 35, 0.12);
}

body {
  font-family: var(--compass-font-ui);
  color: var(--compass-text-strong);
}

/* Keep long-form reading calm while preserving interface clarity */
.hero p,
.card p,
.map-card p,
.deep p,
li {
  line-height: 1.68;
}

/* Headings: tighter, calmer, more app-like */
h1,
h2,
h3 {
  color: var(--compass-text-strong);
  text-wrap: balance;
}

h1 {
  line-height: 0.98;
}

h2 {
  line-height: 1.12;
}

h3 {
  line-height: 1.18;
}

/* Quiet location cue rather than repeated navigation */
.compass-path {
  margin-top: -4px;
  margin-bottom: 18px;
  letter-spacing: 0.01em;
}

.compass-path span {
  gap: 8px;
}

.compass-path strong {
  font-weight: 650;
}

.compass-path a {
  border-bottom: none;
}

/* Softer separation inside dense public pages */
.card + .card,
.map-card + .map-card,
.deep + .card,
.card + .deep {
  margin-top: 18px;
}

/* Folded areas should feel helpful, not heavy */
details.folded summary {
  font-weight: 700;
  cursor: pointer;
}

details.folded p:first-of-type {
  margin-top: 14px;
}

/* Keep buttons and primary actions visually steady */
.actions a {
  min-height: var(--compass-tap-min);
  line-height: 1.2;
}

/* Better wrapping for narrow screens */
p,
li,
summary,
a {
  overflow-wrap: anywhere;
}

@media (max-width: 640px) {
  .compass-path {
    margin-top: -2px;
    margin-bottom: 14px;
  }

  h1 {
    line-height: 1.02;
  }

  .hero p,
  .card p,
  .map-card p,
  .deep p,
  li {
    line-height: 1.62;
  }
}

/* Maps page harmonization
   Keeps maps.html visually aligned with the calmer COMPASS page family. */
body:has(.map-card) main {
  max-width: 1120px;
  margin-left: auto;
  margin-right: auto;
}

body:has(.map-card) .hero {
  max-width: 980px;
  margin-left: auto;
  margin-right: auto;
}

body:has(.map-card) .hero p {
  max-width: 760px;
}

body:has(.map-card) .map-grid {
  gap: 18px;
  align-items: stretch;
}

body:has(.map-card) .map-card {
  border-radius: var(--compass-radius-card);
  box-shadow: 0 18px 50px rgba(22, 35, 63, 0.07);
}

body:has(.map-card) .map-card h3 {
  margin-top: 0;
}

body:has(.map-card) .map-card p {
  color: var(--compass-text-soft);
}

body:has(.map-card) .deep {
  max-width: 980px;
  margin-left: auto;
  margin-right: auto;
}

body:has(.map-card) .card {
  max-width: 980px;
  margin-left: auto;
  margin-right: auto;
}

/* Fallback hook for browsers or future builds if :has support is adjusted */
.maps-page main {
  max-width: 1120px;
  margin-left: auto;
  margin-right: auto;
}

.maps-page .hero,
.maps-page .deep,
.maps-page .card {
  max-width: 980px;
  margin-left: auto;
  margin-right: auto;
}

.maps-page .hero p {
  max-width: 760px;
}

.maps-page .map-grid {
  gap: 18px;
  align-items: stretch;
}

.maps-page .map-card {
  border-radius: var(--compass-radius-card);
  box-shadow: 0 18px 50px rgba(22, 35, 63, 0.07);
}

.maps-page .map-card h3 {
  margin-top: 0;
}

.maps-page .map-card p {
  color: var(--compass-text-soft);
}

@media (max-width: 880px) {
  body:has(.map-card) .map-grid,
  .maps-page .map-grid {
    grid-template-columns: 1fr;
  }
}

/* Maps final visual alignment polish
   Centers public orientation while keeping detailed content readable. */
.maps-page .hero {
  text-align: center;
}

.maps-page .hero p {
  margin-left: auto;
  margin-right: auto;
}

.maps-page .actions {
  justify-content: center;
}

.maps-page .map-card,
.maps-page .deep,
.maps-page .card {
  text-align: left;
}

.maps-page .map-card .eyebrow,
.maps-page .deep .eyebrow,
.maps-page .card .eyebrow {
  text-align: left;
}

.maps-page .map-grid {
  margin-top: 8px;
}

.maps-page .deep,
.maps-page .card {
  margin-top: 24px;
}

.maps-page footer {
  text-align: center;
}

@media (max-width: 640px) {
  .maps-page .hero {
    text-align: left;
  }

  .maps-page .actions {
    justify-content: stretch;
  }
}

/* Shared closing pathway and boundary note */
.compass-close {
  max-width: 980px;
  margin: 42px auto 0;
  padding: 24px;
  border: 1px solid rgba(57, 45, 35, 0.12);
  border-radius: 24px;
  background: rgba(255, 252, 246, 0.68);
  box-shadow: 0 16px 42px rgba(22, 35, 63, 0.05);
}

.compass-close h2 {
  margin-top: 0;
  font-size: clamp(1.35rem, 2vw, 1.85rem);
}

.compass-close p {
  color: var(--compass-text-soft);
  line-height: 1.62;
}

.compass-close-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0;
}

.compass-close-links a {
  min-height: var(--compass-tap-min);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid rgba(57, 45, 35, 0.14);
  background: rgba(255, 255, 255, 0.72);
  color: inherit;
  text-decoration: none;
  font-weight: 700;
}

.compass-close-links a:hover {
  border-color: rgba(57, 45, 35, 0.32);
  transform: translateY(-1px);
}

.compass-boundary {
  margin: 18px 0 0;
  padding-top: 16px;
  border-top: 1px solid rgba(57, 45, 35, 0.10);
  font-size: 0.94rem;
}

@media (max-width: 640px) {
  .compass-close {
    padding: 20px;
    border-radius: 20px;
  }

  .compass-close-links a {
    width: 100%;
  }
}
