/* MGB Patient & Family Resource — support site
 *
 * Deliberately dependency-free: no web fonts, no CDN, no build step. The whole
 * site is three files served straight from GitHub Pages, so it cannot break
 * because something external went away. Colors mirror the app's theme seeds in
 * lib/core/theme/app_theme.dart so the page reads as part of the same product.
 */

:root {
  --mgb-blue: #003a96;
  --mgb-teal: #01828e;
  --ink: #16202e;
  --ink-muted: #4a5769;
  --rule: #dde3ec;
  --surface: #ffffff;
  --surface-sunken: #f5f7fa;
  --notice-bg: #fdf3f4;
  --notice-rule: #ce0037;
  --draft-bg: #fff8e6;
  --draft-rule: #a9750a;
  --cta: #003a96;
  --cta-hover: #01828e;
  --measure: 42rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --mgb-blue: #8fb4ff;
    --mgb-teal: #4fc3cd;
    --ink: #e8edf4;
    --ink-muted: #a4b1c2;
    --rule: #2b3546;
    --surface: #10151d;
    --surface-sunken: #171e29;
    --notice-bg: #2a1319;
    --notice-rule: #ff6b85;
    --draft-bg: #2a2312;
    --draft-rule: #e0b658;
    /* Not --mgb-blue: that flips to a pale tint for links on dark, which made
     * the install button look washed out. White on this blue is 5.8:1. */
    --cta: #2a5fd0;
    --cta-hover: #2457c5;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 0 1.25rem 5rem;
  background: var(--surface);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

.wrap {
  max-width: var(--measure);
  margin: 0 auto;
}

/* ── Masthead ─────────────────────────────────────────────────────────────── */

header.masthead {
  border-bottom: 1px solid var(--rule);
  padding: 2.5rem 0 1.75rem;
  margin-bottom: 2.25rem;
}

.eyebrow {
  margin: 0 0 0.4rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mgb-teal);
}

h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.75rem, 5vw, 2.25rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--mgb-blue);
}

.masthead p {
  margin: 0;
  color: var(--ink-muted);
}

/* ── Typography ───────────────────────────────────────────────────────────── */

h2 {
  margin: 2.75rem 0 0.75rem;
  font-size: 1.3125rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--mgb-blue);
}

h3 {
  margin: 1.75rem 0 0.35rem;
  font-size: 1.0625rem;
  line-height: 1.4;
  color: var(--ink);
}

p {
  margin: 0 0 1rem;
}

ul {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
}

li {
  margin-bottom: 0.5rem;
}

a {
  color: var(--mgb-blue);
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--mgb-teal);
}

a:focus-visible {
  outline: 2px solid var(--mgb-teal);
  outline-offset: 2px;
  border-radius: 2px;
}

strong {
  font-weight: 650;
}

/* ── Callouts ─────────────────────────────────────────────────────────────── */

/* Emergency notice. First thing on the page by design: a caregiver arriving
 * here in a crisis must be routed to 911 before anything else competes. */
.notice {
  background: var(--notice-bg);
  border-left: 4px solid var(--notice-rule);
  border-radius: 0 6px 6px 0;
  padding: 1rem 1.25rem;
  margin: 0 0 2.25rem;
}

.notice p {
  margin: 0;
}

.notice p + p {
  margin-top: 0.6rem;
}

.draft-banner {
  background: var(--draft-bg);
  border-left: 4px solid var(--draft-rule);
  border-radius: 0 6px 6px 0;
  padding: 1rem 1.25rem;
  margin: 0 0 2.25rem;
  font-size: 0.9375rem;
}

.draft-banner p {
  margin: 0;
}

.contact-card {
  background: var(--surface-sunken);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 1.25rem 1.375rem;
  margin: 0 0 1.25rem;
}

.contact-card p:last-child {
  margin-bottom: 0;
}

.contact-card .email {
  font-size: 1.125rem;
  font-weight: 600;
}

/* ── Landing page ─────────────────────────────────────────────────────────── */

.tagline {
  font-size: 1.125rem;
}

/* Get-the-app card. Borrows the shape of an App Store product header (real
 * app icon, name, "Free", one solid button) because that is what reads as
 * official to a family: the page is clearly the app's own, not a link to
 * something unknown. No store badge artwork (see index.html for why). */
.get-app {
  margin: 0 0 1rem;
  padding: 1.25rem;
  border: 1px solid var(--rule);
  border-radius: 16px;
  background: var(--surface-sunken);
}

.get-app-head {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  margin-bottom: 1.125rem;
}

/* Approximates the iOS icon mask so the icon looks like it does on a phone. */
.get-app-icon {
  flex: none;
  width: 60px;
  height: 60px;
  border-radius: 13px;
  box-shadow: 0 0 0 1px var(--rule);
}

.get-app-name {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 650;
  line-height: 1.3;
}

.get-app-meta {
  margin: 0.125rem 0 0;
  color: var(--ink-muted);
  font-size: 0.875rem;
  line-height: 1.4;
}

/* Store buttons. Sized well past Apple's 44pt minimum touch target, since the
 * audience is tired parents on a phone, often one-handed. */
.store-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.store-btn {
  display: flex;
  flex: 1 1 15rem;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  min-height: 3.75rem;
  padding: 0.625rem 1.25rem;
  border-radius: 12px;
  background: var(--cta);
  color: #ffffff;
  text-decoration: none;
  line-height: 1.25;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.12), 0 4px 12px rgb(0 0 0 / 0.08);
}

.store-btn:hover {
  background: var(--cta-hover);
  color: #ffffff;
}

.store-btn:focus-visible {
  border-radius: 12px;
}

.store-btn-icon {
  flex: none;
  width: 1.5rem;
  height: 1.5rem;
}

.store-btn-text {
  display: flex;
  flex-direction: column;
}

.store-btn-main {
  font-size: 1.1875rem;
  font-weight: 650;
}

.store-btn-sub {
  font-size: 0.8125rem;
  opacity: 0.9;
}

/* Platform-aware layout. index.html tags <html data-platform="ios|android|desktop">
 * from the user agent before paint. The matching button becomes the one
 * primary action, full width so a tired parent can't miss it one-handed; the
 * other collapses to its .store-btn-alt line ("Using an Android phone? Get it
 * on Google Play") so a relative on a different phone still has a path. No
 * attribute (JS off, unknown touch device) shows both buttons as equals. A
 * computer ("desktop") gets .get-app-qr instead of the buttons. */
.store-btn-alt {
  display: none;
}

html[data-platform] .store-row {
  flex-direction: column;
  gap: 1rem;
}

/* In the column, the row's 15rem flex-basis would become a height. */
html[data-platform] .store-btn {
  flex: none;
}

html[data-platform="ios"] .store-btn[data-store="ios"],
html[data-platform="android"] .store-btn[data-store="android"] {
  order: -1; /* primary always first, regardless of DOM order */
  min-height: 4.25rem;
}

html[data-platform="ios"] .store-btn[data-store="android"],
html[data-platform="android"] .store-btn[data-store="ios"] {
  display: block;
  min-height: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--ink-muted);
  font-size: 0.9375rem;
  line-height: 1.5;
}

html[data-platform="ios"] .store-btn[data-store="android"] > :not(.store-btn-alt),
html[data-platform="android"] .store-btn[data-store="ios"] > :not(.store-btn-alt) {
  display: none;
}

html[data-platform="ios"] .store-btn[data-store="android"] .store-btn-alt,
html[data-platform="android"] .store-btn[data-store="ios"] .store-btn-alt {
  display: inline;
}

/* Computers: a QR code of this page in place of the store buttons. The SVG
 * carries its own white tile and quiet zone, so it scans in dark mode too. */
.get-app-qr {
  display: none;
}

html[data-platform="desktop"] .store-row {
  display: none;
}

html[data-platform="desktop"] .get-app-qr {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.get-app-qr img {
  flex: none;
  border-radius: 8px;
  box-shadow: 0 0 0 1px var(--rule);
}

.get-app-qr p {
  margin: 0;
  max-width: 22rem;
  line-height: 1.5;
}

.store-btn-alt strong {
  color: var(--mgb-blue);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

/* Feature blocks carry their own rule so the page scans as a list of distinct
 * capabilities rather than one wall of prose. */
.feature {
  border-top: 1px solid var(--rule);
  padding-top: 1.25rem;
  margin-bottom: 1.5rem;
}

.feature h3 {
  margin-top: 0;
  color: var(--mgb-blue);
}

.feature p:last-child {
  margin-bottom: 0;
}

/* ── Footer ───────────────────────────────────────────────────────────────── */

footer {
  border-top: 1px solid var(--rule);
  margin-top: 3.5rem;
  padding-top: 1.5rem;
  font-size: 0.9375rem;
  color: var(--ink-muted);
}

footer p {
  margin: 0 0 0.5rem;
}

/* ── Print (the privacy policy gets printed for legal review) ─────────────── */

@media print {
  body {
    padding: 0;
    font-size: 11pt;
    color: #000;
    background: #fff;
  }

  a {
    color: #000;
  }

  .draft-banner {
    border: 1px solid #000;
  }
}
