/* Real News styles. Built from the RL Forge Works starter (big text, big buttons, high contrast, phone first). */
/* ---------- Colors and sizes (change them here, in one place) ---------- */
:root {
  --blue: #1E5EFF;        /* shield blue — the ONE accent color */
  --blue-dark: #1747C7;   /* darker blue for hover/pressed */
  --text: #111111;        /* almost-black text */
  --text-soft: #3A3A3A;   /* secondary text — still high contrast */
  --bg: #FFFFFF;          /* page background */
  --panel: #F4F6FA;       /* light gray for cards */
  --line: #C9CFDA;        /* borders */
  --danger: #B3261E;      /* "high" severity red (passes contrast) */
  --warn: #8A5A00;        /* "medium" severity amber (passes contrast) */
  --ok: #1B6E2D;          /* "low"/removed green (passes contrast) */
  --radius: 14px;
  --max-width: 720px;
  --tap: 56px;            /* smallest tap target: thumb-sized */
}

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

html {
  font-size: 18px;               /* base size: never smaller than 18px */
  -webkit-text-size-adjust: 100%; /* stop phones from shrinking text */
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  overflow-wrap: break-word;     /* long words/links wrap instead of overflowing */
}

img,
svg {
  max-width: 100%;
  height: auto;
}

/* ---------- Page layout ---------- */
main {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px 16px 48px;
}

/* ---------- Text ---------- */
h1,
h2,
h3 {
  line-height: 1.2;
  margin: 0 0 0.5em;
}

h1 {
  font-size: 2rem;     /* 36px */
  color: var(--blue);
}

h2 {
  font-size: 1.5rem;   /* 27px */
}

h3 {
  font-size: 1.2rem;   /* about 22px */
}

p {
  margin: 0 0 1em;
}

small,
.note {
  font-size: 1rem;     /* "small" text is still 18px */
  color: var(--text-soft);
}

a {
  color: var(--blue-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- Buttons ---------- */
button,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--tap);        /* at least 56px tall */
  min-width: var(--tap);
  padding: 12px 24px;
  font: inherit;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  border: 2px solid var(--blue);
  border-radius: var(--radius);
  background: var(--blue);
  color: #FFFFFF;
  cursor: pointer;
}

button:hover,
.btn:hover {
  background: var(--blue-dark);
  border-color: var(--blue-dark);
}

/* Outline style for less important buttons (e.g. "Back") */
.btn-secondary {
  background: var(--bg);
  color: var(--blue-dark);
}

.btn-secondary:hover {
  background: var(--panel);
  color: var(--blue-dark);
}

/* Full-width button — the big main action on a screen */
.btn-block {
  display: flex;
  width: 100%;
}

button:disabled,
.btn[aria-disabled="true"] {
  background: #E4E7EE;   /* light gray = "not ready yet" */
  border-color: #9AA3B2;
  color: #3A3F4A;        /* dark enough to still read easily */
  cursor: not-allowed;
}

/* Clear focus ring so keyboard users always see where they are */
:focus-visible {
  outline: 4px solid var(--blue);
  outline-offset: 3px;
}

/* ---------- Forms ---------- */
label {
  display: block;
  font-weight: 700;
  margin: 16px 0 6px;
}

input,
select,
textarea {
  display: block;
  width: 100%;
  min-height: var(--tap);
  padding: 12px 14px;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 2px solid var(--line);
  border-radius: 10px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
}

/* Big, easy checkbox */
input[type="checkbox"] {
  display: inline-block;
  width: 28px;
  height: 28px;
  min-height: 0;
  margin: 0 12px 0 0;
  vertical-align: middle;
  accent-color: var(--blue);
}

.error {
  color: var(--danger);
  font-weight: 700;
}

/* ---------- Cards ---------- */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin: 0 0 16px;
}

/* ---------- Severity / status badges ---------- */
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 700;
  color: #FFFFFF;
  background: var(--text-soft);
}

.badge-high { background: var(--danger); }
.badge-med  { background: var(--warn); }
.badge-low  { background: var(--ok); }

/* ---------- Footer ---------- */
footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px 16px 40px;
  border-top: 1px solid var(--line);
  color: var(--text-soft);
}

/* ---------- Wider screens (tablets and computers) ---------- */
@media (min-width: 600px) {
  main {
    padding: 40px 24px 64px;
  }

  h1 {
    font-size: 2.4rem;
  }
}

/* ---------- Home screen (Step 3) ---------- */
.tagline {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 24px;
}

[hidden] {
  display: none !important;
}

/* Back and Home side by side at the top of every screen (Robert's rule) */
.nav-row {
  display: flex;
  gap: 10px;
  margin: 0 0 24px;
}
.nav-row button {
  flex: 1;
  margin: 0;
}

/* Two buttons side by side. If only one shows, it takes the whole row. */
.btn-pair {
  display: flex;
  gap: 10px;
  margin: 10px 0;
}

.btn-pair .btn-block {
  flex: 1 1 0;
  margin: 0;
  padding: 10px 8px;
  font-size: 1rem;
}
.share-status, #share-status {
  margin: 0 0 12px;
  color: var(--ok);
  font-weight: 700;
  overflow-wrap: anywhere;      /* a long link wraps instead of running off the screen */
}
.add-home-help:focus, #add-home-help:focus { outline: 3px solid var(--blue); outline-offset: 2px; }
#add-home-help p { margin: 0 0 10px; }
.add-home-title { font-size: 1.15rem; font-weight: 700; }
/* ---------- Auto-update bar (RL Forge toolkit) ---------- */
.update-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--ok);
  color: var(--bg);
  padding: 14px 16px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}
.update-bar[hidden] {
  display: none;
}
.update-text {
  max-width: var(--max-width);
  margin: 0 auto 10px;
}
.update-buttons {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  gap: 10px;
}
.update-buttons button {
  flex: 1;
  margin: 0;
}
#update-now {
  background: var(--bg);
  color: var(--ok);
  border-color: var(--bg);
}

