/* AU Energy Daily — global styles. Mobile-first, no framework, no webfonts. */
:root {
  --green: #0b5fa5;
  --green-dark: #084a73;
  --amber: #b45309;
  --red: #b91c1c;
  --ink: #1a1a1a;
  --muted: #555;
  --line: #e3e3e3;
  --bg: #ffffff;
  --bg-soft: #f2f7fb;
  --bg-warn: #fef6e7;
  --bg-bad: #fdf0f0;
  --radius: 10px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  font-size: 17px;
}
.wrap { max-width: 860px; margin: 0 auto; padding: 0 16px; }
a { color: var(--green-dark); }
h1 { font-size: 1.9rem; line-height: 1.2; margin: 1.2rem 0 0.5rem; }
h2 { font-size: 1.35rem; margin: 2rem 0 0.5rem; }
h3 { font-size: 1.1rem; margin: 1.4rem 0 0.4rem; }
p { margin: 0.5rem 0; }
ul, ol { margin: 0.5rem 0; padding-left: 1.3rem; }
li { margin: 0.25rem 0; }
.lede { font-size: 1.1rem; color: #333; }

/* Header / footer */
.site-header { background: var(--green-dark); color: #fff; }
.site-header a { color: #fff; text-decoration: none; }
.header-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; padding: 12px 16px; }
.brand { display: flex; align-items: center; gap: 8px; font-size: 1.15rem; }
.brand-mark { font-size: 1.4rem; }
.site-header nav { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-left: auto; }
.site-header nav a { padding: 4px 2px; border-bottom: 2px solid transparent; }
.site-header nav a:hover { border-bottom-color: #fff; }
.site-footer { margin-top: 3rem; padding: 1.5rem 0 2rem; background: var(--bg-soft); border-top: 1px solid var(--line); }
.fine { font-size: 0.85rem; color: var(--muted); }

/* Answer card */
.answer {
  background: var(--bg-soft);
  border: 2px solid var(--green);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin: 1rem 0;
}
.answer .big { font-size: 1.3rem; font-weight: 700; line-height: 1.35; }
.answer .sub { color: #333; margin-top: 4px; }

/* Day bar — 24-hour strip, green = cheap/free, amber = mid, red = peak */
.daybar { display: flex; height: 34px; border-radius: 6px; overflow: hidden; border: 1px solid var(--line); margin: 0.75rem 0 0.25rem; }
.daybar span { flex: 1; }
.daybar .free { background: var(--green); }
.daybar .mid { background: #f5c542; }
.daybar .peak { background: var(--red); }
.daybar .off { background: #cfe4f2; }
.daybar-labels { display: flex; justify-content: space-between; font-size: 0.8rem; color: var(--muted); }
.legend { font-size: 0.85rem; color: var(--muted); margin-top: 0.4rem; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }

/* Cards */
.cards { display: grid; gap: 12px; margin: 1rem 0; }
@media (min-width: 640px) { .cards { grid-template-columns: 1fr 1fr 1fr; } }
.card { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.card h3 { margin-top: 0; }
.card .verdict { font-weight: 700; }
.card .verdict.yes { color: var(--green-dark); }
.card .verdict.no { color: var(--red); }
.card .verdict.maybe { color: var(--amber); }

/* Tool boxes */
.tool { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 1rem 0; background: #fff; }
.tool label { display: block; font-weight: 600; margin: 0.6rem 0 0.25rem; }
.tool input[type="number"], .tool input[type="text"], .tool input[type="email"], .tool select {
  width: 100%; max-width: 340px; padding: 10px 12px; font-size: 1rem;
  border: 1px solid #999; border-radius: 6px;
}
.tool textarea {
  width: 100%; max-width: 560px; min-height: 140px; padding: 10px 12px; font-size: 1rem;
  font-family: inherit; line-height: 1.5;
  border: 1px solid #999; border-radius: 6px; resize: vertical;
}
.tool button {
  margin-top: 1rem; padding: 11px 20px; font-size: 1rem; font-weight: 700;
  background: var(--green); color: #fff; border: none; border-radius: 6px; cursor: pointer;
}
.tool button:hover { background: var(--green-dark); }
.result { margin-top: 1rem; padding: 12px 14px; border-radius: 8px; background: var(--bg-soft); border: 1px solid var(--line); }
.result:empty { display: none; }
.result .big { font-size: 1.25rem; font-weight: 700; }
.result .warn { color: var(--amber); font-weight: 700; }
.result .bad { color: var(--red); font-weight: 700; }
.result .good { color: var(--green-dark); font-weight: 700; }
.hint { font-size: 0.9rem; color: var(--muted); }

/* Tables */
table { width: 100%; border-collapse: collapse; margin: 0.75rem 0; font-size: 0.95rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
th { background: var(--bg-soft); }
.num { text-align: right; }

/* Callouts */
.note { background: var(--bg-warn); border-left: 4px solid var(--amber); padding: 10px 14px; margin: 1rem 0; border-radius: 0 8px 8px 0; }
.note.bad { background: var(--bg-bad); border-left-color: var(--red); }
.note.good { background: var(--bg-soft); border-left-color: var(--green); }
.updated { font-size: 0.85rem; color: var(--muted); }
.state-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 1rem 0; }
.state-links a {
  border: 1px solid var(--green); border-radius: 999px; padding: 6px 14px;
  text-decoration: none; font-weight: 600;
}
.state-links a:hover { background: var(--bg-soft); }
.countdown { font-size: 1.6rem; font-weight: 800; color: var(--red); }

/* Cookie banner */
.cookie-banner {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  background: #123524; color: #fff;
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between;
  padding: 14px 20px; box-shadow: 0 -2px 12px rgba(0,0,0,.25);
}
/* The hidden attribute must win over display:flex above, or the banner never closes */
.cookie-banner[hidden] { display: none; }
.cookie-banner p { margin: 0; font-size: .95rem; max-width: 720px; }
.cookie-banner a { color: #ffd166; }
.cookie-actions { display: flex; gap: 10px; }
.cookie-actions button {
  cursor: pointer; border-radius: 999px; padding: 8px 18px; font-weight: 700; font-size: .95rem;
}
#cookie-accept { background: #ffd166; color: #123524; border: 1px solid #ffd166; }
#cookie-decline { background: transparent; color: #fff; border: 1px solid #fff; }

/* In-page figures */
figure { margin: 1.5rem auto; max-width: 780px; }
figure img { width: 100%; max-width: 100%; height: auto; border-radius: 8px; display: block; }
figcaption { font-size: .9rem; color: #555; margin-top: .5rem; }
.chart-wrap { margin: 1.5rem 0; overflow-x: auto; }
.chart-wrap svg { min-width: 560px; }

/* Never allow horizontal page scroll from a wide element */
html { overflow-x: clip; }

/* Tables scroll instead of overflowing on narrow screens */
table { display: block; overflow-x: auto; max-width: 100%; }

/* Author byline (guides + factor schedule) and author page */
.byline { display: flex; align-items: center; gap: 10px; font-size: .95rem; color: #444; margin: .75rem 0 1.25rem; }
.byline img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.author-photo { max-width: 320px; width: 100%; height: auto; border-radius: 12px; display: block; margin: 1rem 0; }
.author-card { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin: 1rem 0 1.5rem; }
.author-card img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.author-card p { margin: .25rem 0; }
