/* SuperiorWaves. Mobile first: nearly everybody opens this on a phone at the ramp, so the
   layout is built for a thumb and only widens out on a desktop. */

html, body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  margin: 0;
  -webkit-text-size-adjust: 100%;
}

/* Respect the notch and the home indicator on phones. */
.sw-safe-bottom {
  padding-bottom: env(safe-area-inset-bottom, 0);
}

h1:focus {
  outline: none;
}

/* ------------------------------------------------------------------ verdict colours

   One palette used everywhere a go / no-go call appears, so a colour always means the same
   thing whether it is on the hero, a post card or the hourly strip. */

.sw-verdict-excellent { --sw-verdict: #14b8a6; }
.sw-verdict-good      { --sw-verdict: #4ade80; }
.sw-verdict-marginal  { --sw-verdict: #fbbf24; }
.sw-verdict-poor      { --sw-verdict: #fb923c; }
.sw-verdict-dangerous { --sw-verdict: #ef4444; }

.sw-verdict-bar {
  background: var(--sw-verdict, #90a4ae);
  border-radius: 4px;
  height: 100%;
  width: 6px;
}

.sw-verdict-text {
  color: var(--sw-verdict, #90a4ae);
  font-weight: 700;
}

/* ------------------------------------------------------------------ hero */

.sw-hero {
  background: linear-gradient(150deg, #0b2942 0%, #123a5c 45%, #1b5478 100%);

  /* Rounded all round, because the page has side padding and the hero sits inside it as a
     card. Square top corners only made sense back when it bled to the window edge. */
  border-radius: 20px;
  color: #fff;
  overflow: hidden;
  position: relative;
}

.sw-hero::after {
  background: radial-gradient(circle at 80% 10%, rgba(255, 255, 255, 0.14), transparent 55%);
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
}

.sw-hero-call {
  font-size: clamp(2.6rem, 13vw, 4.2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}

.sw-hero-sub {
  font-size: 1.05rem;
  font-weight: 500;
  opacity: 0.92;
}

.sw-score-ring {
  align-items: center;
  display: flex;
  justify-content: center;
  position: relative;
}

.sw-score-ring-value {
  font-size: 1.5rem;
  font-weight: 800;
  position: absolute;
}

/* ------------------------------------------------------------------ hourly strip */

.sw-hour-strip {
  -webkit-overflow-scrolling: touch;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 12px 2px;
  scroll-snap-type: x proximity;
}

.sw-hour-strip::-webkit-scrollbar {
  height: 6px;
}

.sw-hour-strip::-webkit-scrollbar-thumb {
  background: rgba(128, 128, 128, 0.35);
  border-radius: 3px;
}

.sw-hour {
  border-radius: 12px;
  flex: 0 0 auto;
  min-width: 68px;
  padding: 8px 6px;
  scroll-snap-align: start;
  text-align: center;
  transition: transform 120ms ease;
}

.sw-hour-selected {
  outline: 2px solid var(--mud-palette-primary);
  outline-offset: 1px;
}

.sw-hour-night {
  opacity: 0.55;
}

.sw-hour-bar {
  background: var(--sw-verdict, #90a4ae);
  border-radius: 3px;
  height: 5px;
  margin: 6px auto 0 auto;
  width: 70%;
}

/* ------------------------------------------------------------------ wave scale */

.sw-wave-track {
  background: linear-gradient(90deg, #14b8a6 0%, #4ade80 22%, #fbbf24 48%, #fb923c 70%, #ef4444 100%);
  border-radius: 6px;
  height: 10px;
  position: relative;
  width: 100%;
}

.sw-wave-marker {
  background: #fff;
  border: 3px solid #0b2942;
  border-radius: 50%;
  height: 20px;
  margin-left: -10px;
  position: absolute;
  top: -5px;
  width: 20px;
}

/* ------------------------------------------------------------------ maps and editor */

.sw-map {
  border-radius: 14px;
  height: 320px;
  overflow: hidden;
  width: 100%;
  z-index: 0;
}

.sw-map-small {
  height: 200px;
}

/* Leaflet stacks above MudBlazor overlays without this. */
.leaflet-pane,
.leaflet-top,
.leaflet-bottom {
  z-index: 400 !important;
}

.sw-editor {
  min-height: 180px;
}

.ql-toolbar.ql-snow,
.ql-container.ql-snow {
  border-color: var(--mud-palette-lines-default);
}

.ql-toolbar.ql-snow {
  border-radius: 8px 8px 0 0;
}

.ql-container.ql-snow {
  border-radius: 0 0 8px 8px;
  font-family: inherit;
  font-size: 1rem;
}

.ql-editor {
  min-height: 170px;
}

/* ------------------------------------------------------------------ post content */

.sw-post-body {
  line-height: 1.65;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.sw-post-body p {
  margin: 0 0 0.85em 0;
}

.sw-post-body ul,
.sw-post-body ol {
  margin: 0 0 0.85em 0;
  padding-left: 1.4em;
}

.sw-post-body blockquote {
  border-left: 3px solid var(--mud-palette-primary);
  color: var(--mud-palette-text-secondary);
  margin: 0 0 0.85em 0;
  padding-left: 1em;
}

.sw-post-body img {
  border-radius: 10px;
  max-width: 100%;
}

.sw-post-body a {
  color: var(--mud-palette-primary);
}

/* A magic link from an SMS lands directly on one reply, so flag which one. */
.sw-flash {
  animation: sw-flash-anim 2.4s ease-out;
}

@keyframes sw-flash-anim {
  0%   { background-color: rgba(251, 191, 36, 0.35); }
  100% { background-color: transparent; }
}

/* ------------------------------------------------------------------ layout helpers */

.sw-page {
  margin: 0 auto;
  max-width: 900px;

  /* MudMainContent already clears the fixed app bar. This is just breathing room under it.
     Never add a pt-* utility class to MudMainContent itself: those carry !important and will
     wipe out that clearance, dropping the page behind the bar. */
  padding-top: 12px;
  padding-bottom: 84px;
}

.sw-wide {
  max-width: 1180px;
}

.sw-sticky-actions {
  backdrop-filter: blur(8px);
  bottom: 0;
  position: sticky;
  z-index: 5;
}

.sw-truncate-2 {
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  display: -webkit-box;
  overflow: hidden;
}

.sw-truncate-3 {
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  display: -webkit-box;
  overflow: hidden;
}

.sw-clickable {
  cursor: pointer;
}

.sw-clickable:hover {
  filter: brightness(1.03);
}

/* Bottom navigation only exists on phones; desktop uses the rail in the app bar. */
.sw-bottom-nav {
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--mud-palette-lines-default);
  bottom: 0;
  left: 0;
  position: fixed;
  right: 0;
  z-index: 1200;
}

@media (min-width: 960px) {

  .sw-bottom-nav {
    display: none;
  }

  .sw-page {
    padding-bottom: 24px;
  }
}

/* ------------------------------------------------------------------ error banner */

#blazor-error-ui {
  background: #b32121;
  bottom: 0;
  box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
  box-sizing: border-box;
  color: #fff;
  display: none;
  left: 0;
  padding: 0.7rem 1.25rem;
  position: fixed;
  width: 100%;
  z-index: 3000;
}

#blazor-error-ui a {
  color: #fff;
  text-decoration: underline;
}

#blazor-error-ui .dismiss {
  cursor: pointer;
  position: absolute;
  right: 0.9rem;
  top: 0.6rem;
}

.blazor-error-boundary {
  background: #b32121;
  color: #fff;
  padding: 1rem;
}

.blazor-error-boundary::after {
  content: "Something went wrong rendering this section.";
}

/* Your own position on the map. A quiet pulse so it never gets lost among the spot pins. */
.sw-you-marker {
  animation: sw-pulse 2.4s ease-in-out infinite;
}

@keyframes sw-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.55; }
}

.sw-map-home {
  border-radius: 14px;
  height: 240px;
  overflow: hidden;
  width: 100%;
  z-index: 0;
}

/* The friendly "what to expect" block. Deliberately looks different from the analysis. */
.sw-expect {
  background: linear-gradient(135deg, rgba(27, 84, 120, 0.10), rgba(20, 184, 166, 0.10));
  border-left: 3px solid var(--mud-palette-secondary);
  border-radius: 10px;
  line-height: 1.7;
}

/* Present to a screen reader and to a crawler, absent to the eye. The conditions page leads
   with a verdict ring rather than a headline, so its real heading lives here. */
.sw-visually-hidden {
  border: 0;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}
