/* Shared resort context (A9): the app bar at the top of every page except the map, and the "Which resort are you at?"
   picker dialog (resort.js). Colours, type and motion come from design/tokens.css. */

/* ---------- App bar ---------- */

.app-bar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 8px;
  min-height: 60px; padding: 8px var(--gutter);
  background: var(--glass-thick);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border-bottom: 1px solid var(--separator);
  font-family: var(--font);
  color: var(--text);
}
.app-logo {
  display: flex; align-items: center; gap: 8px;
  color: var(--navy); text-decoration: none;
  font-family: var(--font-display); font-weight: 700; font-size: 17px; letter-spacing: var(--tracking-title);
  white-space: nowrap;
}
.app-logo svg { width: 28px; height: 28px; flex: none; }
.app-logo:hover { color: var(--accent); }

.app-resort {
  display: flex; align-items: center; gap: 8px;
  margin-left: 4px; padding: 4px 10px 4px 6px; height: 44px;
  max-width: min(60vw, 320px);
  border: 0; border-radius: 12px;
  background: var(--fill); color: var(--text);
  font: inherit; text-align: left; cursor: pointer;
  transition: background var(--dur-fast) var(--ease);
}
.app-resort:hover { background: var(--fill-hover); }
.app-resort > svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; color: var(--muted); }
.app-resort-icon {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--navy); color: #fff;
}
.app-resort-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.rp-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.rp-text small { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.rp-text strong { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.app-nav { margin-left: auto; display: flex; gap: 4px; }
.app-nav a {
  padding: 8px 12px; border-radius: 10px;
  color: var(--text); text-decoration: none; font-size: 15px; font-weight: 500;
  transition: background var(--dur-fast) var(--ease);
}
.app-nav a:hover { background: var(--fill); }
.app-nav a[aria-current="page"] { background: var(--fill-2); font-weight: 600; }

.app-menu {
  display: none; margin-left: auto;
  width: 44px; height: 44px; flex: none;
  border: 0; border-radius: 12px; background: var(--fill); color: var(--text); cursor: pointer;
}
.app-menu svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.app-menu[aria-expanded="true"] { background: var(--fill-hover); }

.app-bar button:focus-visible, .app-bar a:focus-visible, .rp button:focus-visible, .rp a:focus-visible {
  outline: 3px solid var(--focus-ring); outline-offset: 1px;
}

@media (max-width: 860px) {
  .app-menu { display: grid; place-items: center; }
  .app-logo span { display: none; }
  .app-resort { max-width: none; flex: 1; }
  .app-nav {
    display: none;
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 2px;
    padding: 8px var(--gutter) 12px;
    background: var(--glass-solid);
    -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
    border-bottom: 1px solid var(--separator);
    box-shadow: var(--shadow);
  }
  .app-nav.open { display: flex; }
  .app-nav a { padding: 12px 14px; font-size: 16px; }
}

/* ---------- Resort picker dialog ---------- */

.rp {
  width: min(540px, calc(100vw - 32px));
  max-height: min(760px, calc(100vh - 32px));
  padding: 0; border: 0; border-radius: var(--radius-lg);
  background: var(--glass-solid);
  box-shadow: var(--shadow);
  color: var(--text); font-family: var(--font); font-size: 15px;
}
.rp[open] { display: flex; flex-direction: column; animation: rp-in var(--dur) var(--ease-out); }
.rp::backdrop { background: rgb(var(--navy-rgb) / .35); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
@keyframes rp-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }

.rp-head { display: flex; align-items: center; gap: 8px; padding: 16px 14px 8px 20px; }
.rp-head h2 { flex: 1; margin: 0; font-family: var(--font-display); font-size: var(--text-title); font-weight: 700; letter-spacing: var(--tracking-title); color: var(--navy); }
.rp-icon {
  width: 36px; height: 36px; flex: none;
  border: 0; border-radius: 50%; background: var(--fill-2); color: var(--text); cursor: pointer;
  display: grid; place-items: center;
}
.rp-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.rp-icon:hover { background: var(--fill-hover); }

.rp-search { padding: 0 16px 8px; }
.rp-search input {
  width: 100%; height: 44px; padding: 0 14px;
  border: 0; border-radius: 12px; background: var(--fill);
  font: inherit; font-size: 16px; color: var(--text);
}
.rp-search input::placeholder { color: var(--muted); }
.rp-search input:focus { outline: 3px solid var(--focus-ring); }

.rp-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 4px 8px 8px; }
.rp-group { margin: 14px 12px 6px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.rp-list { list-style: none; margin: 0; padding: 0; }
.rp-item { display: flex; align-items: center; gap: 2px; }
.rp-row {
  flex: 1; min-width: 0;
  display: flex; align-items: center; gap: 12px;
  padding: 8px 12px; border: 0; border-radius: 12px;
  background: none; color: inherit; font: inherit; text-align: left; cursor: pointer;
  transition: background var(--dur-fast) var(--ease);
}
.rp-row:hover { background: var(--fill); }
.rp-row .rp-text strong { font-size: 15px; }
.rp-row .rp-text small { font-size: 13px; font-weight: 400; letter-spacing: 0; text-transform: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rp-icon-circle {
  width: 36px; height: 36px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--fill-2); color: var(--navy);
}
.rp-icon-circle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.rp-icon-circle.demo { background: rgb(164 80 42 / .12); color: var(--poi-food); }
.rp-item.mine .rp-icon-circle { background: var(--navy); color: #fff; }
.rp-tag {
  display: inline-block; margin-left: 6px; padding: 1px 7px; vertical-align: 2px;
  border-radius: 999px; background: var(--accent); color: #fff;
  font-size: 11px; font-weight: 600;
}

.rp-star {
  width: 40px; height: 40px; flex: none;
  border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer;
  display: grid; place-items: center;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.rp-star svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.rp-star:hover { background: var(--fill); color: var(--text); }
.rp-star[aria-pressed="true"] { color: var(--caution); }
.rp-star[aria-pressed="true"] svg { fill: currentColor; }
.rp-star:active { transform: scale(.9); }

.rp-locate {
  display: flex; align-items: center; gap: 10px;
  width: calc(100% - 8px); margin: 4px; padding: 10px 12px;
  border: 0; border-radius: 12px;
  background: rgb(var(--accent-rgb) / .1); color: var(--accent);
  font: inherit; font-weight: 600; text-align: left; cursor: pointer;
}
.rp-locate:hover { background: rgb(var(--accent-rgb) / .16); }
.rp-locate:disabled { opacity: .6; cursor: default; }
.rp-locate svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }

.rp-current { display: flex; align-items: center; gap: 12px; margin: 4px; padding: 8px 12px; border-radius: 12px; background: var(--fill); }
.rp-current .rp-text { flex: 1; }
.rp-small {
  height: 32px; padding: 0 12px; flex: none;
  border: 0; border-radius: 8px; background: #fff; box-shadow: 0 1px 3px var(--stroke);
  font: inherit; font-size: 13px; font-weight: 600; color: var(--text); cursor: pointer;
}
.rp-small:hover { background: var(--snow); }
.rp-note { margin: 12px; font-size: 14px; color: var(--muted); }
.rp-foot { margin: 0; padding: 10px 20px 14px; border-top: 1px solid var(--separator); font-size: 12px; color: var(--muted); }
.rp-foot a { color: var(--accent); }

@media (max-width: 600px) {
  .rp {
    width: 100vw; max-width: 100vw; max-height: 92vh;
    margin: auto 0 0; inset: 0;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .rp[open] { animation-name: rp-up; }
  @keyframes rp-up { from { transform: translateY(40px); opacity: 0; } }
}

@media (prefers-reduced-motion: reduce) {
  .rp[open] { animation: rp-fade var(--dur-fast) linear; }
  @keyframes rp-fade { from { opacity: 0; } }
  .rp-star:active { transform: none; }
}

/* ---------- Resort summary card (inner pages) and the piste mix bar (also used by the dashboard) ---------- */

.rs-card {
  padding: 20px 22px; margin: 0 0 24px;
  background: #fff; border-radius: var(--radius-lg);
  box-shadow: 0 1px 3px rgb(var(--navy-rgb) / .08), 0 6px 20px rgb(var(--navy-rgb) / .06);
  font-family: var(--font); color: var(--text);
}
.rs-head { display: flex; align-items: center; gap: 12px; }
.rs-head .rp-icon-circle { width: 44px; height: 44px; background: var(--navy); color: #fff; }
.rs-head .rp-icon-circle svg { width: 24px; height: 24px; }
.rs-titles { flex: 1; min-width: 0; }
.rs-titles h2 { margin: 0; font-family: var(--font-display); font-size: 24px; font-weight: 700; letter-spacing: var(--tracking-title); color: var(--navy); line-height: 1.2; }
.rs-titles p { margin: 2px 0 0; color: var(--muted); font-size: 15px; }
.rs-lead { margin: 14px 0 0; color: var(--muted); font-size: 15px; max-width: 640px; }
.rs-facts { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.rs-facts li { padding: 6px 12px; border-radius: 999px; background: var(--fill); font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.rs-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.rs-actions .rs-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px; border: 0; border-radius: 12px;
  background: var(--fill-2); color: var(--text);
  font: inherit; font-size: 15px; font-weight: 600; text-decoration: none; cursor: pointer;
}
.rs-actions .rs-btn:hover { background: var(--fill-hover); }
.rs-actions .rs-btn.primary { background: var(--accent); color: var(--on-accent); }
.rs-actions .rs-btn.primary:hover { background: var(--accent-hover); }
.rs-actions .rs-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.mix { margin-top: 16px; max-width: 560px; }
.mix-bar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; gap: 2px; }
.mix-bar i { display: block; min-width: 3px; }
.mix-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.mix-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }

/* Buttons that look like links (widget footers, notes on the inner pages) */
.link-btn { border: 0; padding: 0; background: none; font: inherit; font-weight: 600; color: var(--accent); cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
