/* The Pod Companion — shared styles */

:root {
  /* Core palette */
  --ink-slate: #1E2430;
  --parchment: #F7F4EC;
  --card: #FFFFFF;
  --card-border: #E2DCCE;
  --accent: #C8873A;
  --accent-hover: #B0762D;

  /* Body text on light backgrounds */
  --text: #1E2430;
  --text-muted: #4A5566;
  --text-inverse: #F7F4EC;

  /* Muted mana accents — small functional touches only */
  --mana-w: #E8DFC8;
  --mana-u: #3D6B9E;
  --mana-b: #3A3542;
  --mana-r: #B0442E;
  --mana-g: #3F7A4E;

  /* Layout */
  --radius: 6px;
  --radius-lg: 10px;
  --shadow-card: 0 1px 2px rgba(30, 36, 48, 0.06), 0 2px 6px rgba(30, 36, 48, 0.04);
  --max-content: 780px;
  --max-wide: 1080px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: var(--parchment);
}

/* Layout */
.container {
  width: 100%;
  max-width: var(--max-content);
  margin: 0 auto;
  padding: 0 20px;
}

.container-wide {
  max-width: var(--max-wide);
}

/* Header */
.site-header {
  background: var(--ink-slate);
  color: var(--text-inverse);
  border-bottom: 3px solid var(--accent);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  padding-bottom: 14px;
  flex-wrap: wrap;
  gap: 10px;
}

.brand {
  color: var(--text-inverse);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.brand-mark {
  display: inline-block;
  width: 22px; height: 22px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  position: relative;
}
.brand-mark::before {
  content: "";
  position: absolute; inset: 3px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.5;
}

.site-nav ul {
  list-style: none;
  margin: 0; padding: 0;
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.site-nav a {
  color: var(--text-inverse);
  text-decoration: none;
  font-size: 0.95rem;
  padding: 4px 2px;
  border-bottom: 2px solid transparent;
}

.site-nav a:hover,
.site-nav a:focus {
  color: var(--accent);
  border-bottom-color: var(--accent);
  outline: none;
}

/* Main */
main {
  padding: 32px 0 48px;
}

/* Headings */
h1, h2, h3, h4 {
  color: var(--ink-slate);
  line-height: 1.25;
  margin-top: 1.8em;
  margin-bottom: 0.5em;
  font-weight: 700;
}
h1 { font-size: 2rem; margin-top: 0.4em; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.15rem; }

p, ul, ol { margin: 0.6em 0 1em; }

a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}
a:hover, a:focus { color: var(--accent-hover); }

hr {
  border: 0;
  border-top: 1px solid var(--card-border);
  margin: 2em 0;
}

/* Cards */
.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-card);
  margin: 1.5em 0;
}

/* Hero (homepage) */
.hero {
  padding: 48px 0 24px;
}
.hero h1 { font-size: 2.25rem; margin-bottom: 0.3em; }
.hero p.lede { font-size: 1.15rem; color: var(--text-muted); }

.feature-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin: 24px 0;
}
@media (min-width: 720px) {
  .feature-grid { grid-template-columns: 1fr 1fr; }
}

.feature-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-card);
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
}
.feature-card p:last-child {
  margin-top: auto;
}
.feature-card h2 { margin-top: 0; }
.feature-card .tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 100px;
  margin-bottom: 8px;
}
.tag-live { background: var(--mana-g); color: #fff; }
.tag-soon { background: var(--mana-u); color: #fff; }

/* Buttons */
.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 10px 18px;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
  border: 0;
  cursor: pointer;
  font-size: 1rem;
}
.btn:hover, .btn:focus { background: var(--accent-hover); color: #fff; }

/* Calculator widget */
.mana-calc {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-card);
  margin: 24px 0;
}
.mana-calc h2 { margin-top: 0; }

.calc-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 640px) {
  .calc-form { grid-template-columns: 1fr 1fr; }
  .calc-form .full { grid-column: 1 / -1; }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.field label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
}
.field .hint {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.field input[type="number"],
.field select {
  padding: 8px 10px;
  font-size: 1rem;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  min-height: 40px;
}
.field input[type="number"]:focus,
.field select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

.toggle-group {
  display: inline-flex;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  overflow: hidden;
}
.toggle-group input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.toggle-group label {
  padding: 8px 14px;
  cursor: pointer;
  font-size: 0.95rem;
  background: #fff;
  color: var(--text);
  border-right: 1px solid var(--card-border);
}
.toggle-group label:last-child { border-right: 0; }
.toggle-group input[type="radio"]:checked + label {
  background: var(--accent);
  color: #fff;
}
.toggle-group input[type="radio"]:focus + label {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* Advanced options toggle (used on spoke pages) */
.calc-advanced {
  margin-top: 12px;
}
.calc-advanced summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--accent);
  padding: 6px 0;
}
.calc-advanced summary:hover { color: var(--accent-hover); }
.calc-advanced[open] summary { margin-bottom: 10px; }

/* Results */
.calc-results { margin-top: 20px; }
.result-headline {
  background: var(--parchment);
  border: 1px solid var(--card-border);
  border-left: 4px solid var(--accent);
  padding: 14px 16px;
  border-radius: var(--radius);
  font-size: 1.05rem;
  line-height: 1.5;
}
.result-headline strong {
  color: var(--ink-slate);
  font-size: 1.25rem;
}
.result-headline .rec {
  margin-top: 8px;
  display: block;
}

.calc-table {
  margin-top: 18px;
  overflow-x: auto;
}
.calc-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.calc-table th, .calc-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--card-border);
}
.calc-table th {
  background: var(--parchment);
  color: var(--ink-slate);
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.calc-table tr.rec-row td {
  background: rgba(200, 135, 58, 0.08);
  font-weight: 700;
}
.calc-table tr.rec-row td:first-child::before {
  content: "★ ";
  color: var(--accent);
}
.calc-table td.pct-below { color: var(--mana-r); }
.calc-table td.pct-meets { color: var(--mana-g); font-weight: 600; }

/* Mana pip tags (small, for content flavor) */
.pip {
  display: inline-block;
  width: 1.1em; height: 1.1em;
  line-height: 1.1em;
  border-radius: 50%;
  text-align: center;
  font-size: 0.75em;
  font-weight: 700;
  vertical-align: middle;
  margin: 0 1px;
  color: #fff;
}
.pip-w { background: var(--mana-w); color: var(--ink-slate); }
.pip-u { background: var(--mana-u); }
.pip-b { background: var(--mana-b); }
.pip-r { background: var(--mana-r); }
.pip-g { background: var(--mana-g); }

/* FAQ */
.faq details {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 10px;
}
.faq details summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--ink-slate);
  padding: 4px 0;
}
.faq details[open] summary { margin-bottom: 8px; }

/* Related guides block */
.related {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin: 2em 0;
}
.related h2 { margin-top: 0; font-size: 1.15rem; }
.related ul { list-style: none; padding: 0; margin: 0; }
.related li { margin: 6px 0; }
.related li a { font-weight: 600; }
.related li .desc {
  display: block;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 400;
  text-decoration: none;
}

/* Ad placeholder (visible in dev, hidden in production if desired) */
.ad-slot {
  border: 1px dashed var(--card-border);
  background: var(--parchment);
  color: var(--text-muted);
  text-align: center;
  padding: 20px;
  border-radius: var(--radius);
  margin: 24px 0;
  font-size: 0.85rem;
}

/* Footer */
.site-footer {
  background: var(--ink-slate);
  color: var(--text-inverse);
  padding: 32px 0 20px;
  margin-top: 48px;
  font-size: 0.92rem;
}
.site-footer a {
  color: var(--text-inverse);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.site-footer a:hover, .site-footer a:focus {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}
@media (min-width: 640px) {
  .footer-grid { grid-template-columns: 2fr 1fr 1fr; }
}
.footer-grid h3 {
  color: var(--text-inverse);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 10px;
}
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin: 6px 0; }
.footer-disclaimer {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid rgba(247, 244, 236, 0.15);
  font-size: 0.8rem;
  color: rgba(247, 244, 236, 0.7);
  line-height: 1.5;
}

/* Utility */
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.small { font-size: 0.9rem; }

/* Reduce motion respect */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
