/* =========================================================
   RidgeRelay — Modern Familiar UI (AllTrails-inspired shell)
   Goal: engaging + calm + safety-forward (not social-first)
   ========================================================= */ 

:root{
  --bg: #0b0f14;
  --panel: rgba(255,255,255,.92);
  --panel2: rgba(255,255,255,.84);
  --ink: #0b1220;
  --muted: rgba(11,18,32,.68);
  --border: rgba(11,18,32,.12);
  --shadow: 0 18px 50px rgba(11,18,32,.10);
  --r: 18px;

  /* Theme option C (modern/serious) */
  --accent: #f06a1a;       /* safety orange */
  --tan: #b9b39f;          /* warm tan */
  --focus: rgba(240,106,26,.25);

  --max: 1120px;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  color: var(--ink);
  background:
    radial-gradient(1200px 800px at 20% 10%, rgba(255,255,255,.55), transparent 60%),
    linear-gradient(90deg, rgba(185,179,159,1) 0%, rgba(185,179,159,1) 70%, rgba(240,106,26,.35) 100%);
}

/* Subtle topo texture (not “busy”) */
body::before{
  content:"";
  position: fixed;
  inset: 0;
  pointer-events:none;
  z-index:0;
  opacity:.14;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='800' height='600' viewBox='0 0 800 600'%3E%3Cg fill='none' stroke='%230b1220' stroke-opacity='0.9' stroke-width='2'%3E%3Cpath d='M80 130c80-70 170-70 250 0s170 70 250 0 170-70 250 0'/%3E%3Cpath d='M40 240c120-110 250-110 370 0s250 110 370 0 250-110 370 0'/%3E%3Cpath d='M60 360c100-60 200-60 300 0s200 60 300 0 200-60 300 0'/%3E%3Cpath d='M70 470c120-80 240-80 360 0s240 80 360 0 240-80 360 0'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 900px 700px;
  background-repeat: repeat;
}

.rr-banner{
  position: sticky;
  top:0;
  z-index: 10;
  background: rgba(11,18,32,.88);
  color: rgba(255,255,255,.92);
  padding: 10px 14px;
  font-size: 13px;
  letter-spacing: .2px;
}

.rr-topbar{
  position: sticky;
  top: 42px;
  z-index: 9;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding: 14px 16px;
  max-width: var(--max);
  margin: 0 auto;
}

.rr-brand{
  display:flex;
  align-items:center;
  gap:12px;
}

.rr-logo{
  width:42px; height:42px;
  border-radius: 14px;
  display:grid;
  place-items:center;
  font-weight: 900;
  background: rgba(255,255,255,.88);
  border:1px solid var(--border);
  box-shadow: var(--shadow);
}

.rr-name{ font-weight: 900; letter-spacing: .3px; }
.rr-tag{ font-size: 12px; color: var(--muted); margin-top: 2px; }

.rr-top-actions{ display:flex; gap:10px; }

.rr-shell{
  position: relative;
  z-index: 1; /* above background texture */
  display:grid;
  grid-template-columns: 280px 1fr;
  gap: 16px;
  max-width: var(--max);
  margin: 0 auto;
  padding: 16px;
}

.rr-sidebar{
  background: var(--panel2);
  border:1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 14px;
  height: calc(100vh - 140px);
  position: sticky;
  top: 116px;
  overflow:auto;
}

.rr-side-title{
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .12em;
  margin: 8px 0 10px;
}

.rr-navitem{
  width:100%;
  text-align:left;
  padding: 10px 12px;
  border-radius: 12px;
  border:1px solid transparent;
  background: transparent;
  cursor:pointer;
  font-weight: 800;
}
.rr-navitem:hover{ background: rgba(11,18,32,.05); }
.rr-navitem.active{
  background: rgba(240,106,26,.10);
  border-color: rgba(240,106,26,.30);
}

.rr-divider{ height:1px; background: var(--border); margin: 14px 0; }

.rr-side-note{
  margin-top: 14px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
}

.rr-content{ padding-bottom: 90px; }

.rr-screen{ display:none; }
.rr-screen.show{ display:block; }

.rr-hero{
  background: var(--panel);
  border:1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 18px;
}
.rr-hero h1{ margin:0 0 6px; font-size: 26px; letter-spacing: -.2px; }
.rr-hero p{ margin:0; color: var(--muted); line-height: 1.35; }

.rr-searchrow{
  margin-top: 14px;
  display:flex;
  gap:10px;
}
.rr-search{
  flex:1;
  padding: 12px 12px;
  border-radius: 14px;
  border:1px solid var(--border);
  outline:none;
  background: rgba(255,255,255,.9);
}
.rr-search:focus{ box-shadow: 0 0 0 4px var(--focus); }

.rr-filters{
  margin-top: 12px;
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

.rr-chip{
  padding: 8px 10px;
  border-radius: 999px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.84);
  cursor:pointer;
  font-weight: 800;
  font-size: 12px;
}
.rr-chip-active{
  border-color: rgba(240,106,26,.35);
  background: rgba(240,106,26,.12);
}

.rr-sectionhead{
  margin: 16px 0 10px;
}
.rr-sectionhead h2{ margin:0; font-size: 18px; }
.rr-sectionhead p{ margin:6px 0 0; color: var(--muted); }

.rr-grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.rr-card{
  background: var(--panel);
  border:1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 16px;
}
.rr-card h3{ margin:0 0 6px; font-size: 16px; }
.rr-muted{ color: var(--muted); }

.rr-trailmeta{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
}

.rr-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}

.rr-btn{
  border:1px solid var(--border);
  background: rgba(255,255,255,.92);
  padding: 10px 12px;
  border-radius: 14px;
  cursor:pointer;
  font-weight: 900;
}
.rr-btn:focus{ outline:none; box-shadow: 0 0 0 4px var(--focus); }
.rr-btn-primary{
  border-color: rgba(240,106,26,.35);
  background: rgba(240,106,26,.14);
}
.rr-btn-ghost{
  background: transparent;
}
.rr-btn-danger{
  border-color: rgba(239,68,68,.35);
  background: rgba(239,68,68,.12);
}
.rr-btn-block{ width:100%; margin-top: 8px; }

.rr-heart{
  width:42px; height:42px;
  display:grid;
  place-items:center;
  border-radius: 14px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.92);
  cursor:pointer;
  font-weight: 900;
}
.rr-heart.on{
  border-color: rgba(240,106,26,.35);
  background: rgba(240,106,26,.14);
}

.rr-formrow{ display:flex; flex-direction:column; gap:6px; margin-top: 10px; }
.rr-formrow label{ font-weight: 900; font-size: 12px; color: rgba(11,18,32,.8); }
.rr-formrow input, .rr-formrow select{
  padding: 12px 12px;
  border-radius: 14px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.92);
  outline:none;
}
.rr-formrow input:focus, .rr-formrow select:focus{ box-shadow: 0 0 0 4px var(--focus); }

.rr-formgrid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.rr-pillrow{ display:flex; gap:8px; flex-wrap:wrap; }
.rr-pill{
  font-size: 12px;
  font-weight: 900;
  padding: 8px 10px;
  border-radius: 999px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.85);
}
.rr-pill-add{ cursor:pointer; background: rgba(240,106,26,.10); border-color: rgba(240,106,26,.25); }

.rr-actions{
  display:flex;
  justify-content:flex-end;
  gap:10px;
  margin-top: 12px;
  flex-wrap:wrap;
}

.rr-callout{
  margin-top: 12px;
  padding: 12px;
  border-radius: 14px;
  border:1px solid rgba(240,106,26,.25);
  background: rgba(240,106,26,.08);
}

.rr-status{ display:flex; gap:10px; align-items:center; margin-bottom: 12px; }
.rr-badge{
  display:inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 12px;
  border:1px solid var(--border);
}
.rr-badge-ok{ background: rgba(34,197,94,.12); border-color: rgba(34,197,94,.25); }
.rr-badge-warn{ background: rgba(245,158,11,.12); border-color: rgba(245,158,11,.25); }
.rr-badge-bad{ background: rgba(239,68,68,.12); border-color: rgba(239,68,68,.25); }

.rr-feed{ margin-top: 12px; display:flex; flex-direction:column; gap:8px; }
.rr-feeditem{
  padding: 10px 12px;
  border-radius: 14px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.86);
}
.rr-time{ font-weight: 900; margin-right: 8px; }

/* Mobile bottom nav */
.rr-bottomnav{
  position: fixed;
  left:0; right:0; bottom:0;
  display:none;
  gap:0;
  background: rgba(255,255,255,.94);
  border-top: 1px solid var(--border);
  padding: 10px;
  z-index: 12;
}
.rr-tab{
  flex:1;
  border:1px solid transparent;
  background: transparent;
  padding: 10px 10px;
  border-radius: 14px;
  font-weight: 900;
  cursor:pointer;
}
.rr-tab.active{
  background: rgba(240,106,26,.12);
  border-color: rgba(240,106,26,.25);
}

/* Responsive */
@media (max-width: 980px){
  .rr-shell{ grid-template-columns: 1fr; }
  .rr-sidebar{ display:none; }
  .rr-grid{ grid-template-columns: 1fr; }
  .rr-bottomnav{ display:flex; }
  .rr-top-actions{ display:none; } /* top actions move to bottom nav on mobile */
  .rr-topbar{ top:42px; }
}

.rr-sr-only{
  position:absolute;
  width:1px; height:1px;
  padding:0; margin:-1px;
  overflow:hidden; clip:rect(0,0,0,0);
  white-space:nowrap; border:0;
}
