/* PracticeRC — shared styles for static SEO/content pages.
   Brand tokens mirror the app (see frontend/src/index.css & landing Layout.astro).
   Theme follows the app: default dark, overridable via data-theme on <html>. */

:root {
  color-scheme: light;
  --page-bg: #f4eee3;
  --page-bg-tint: #efe7d8;
  --surface: #fffcf6;
  --surface-2: #faf4e8;
  --border: #e4dac8;
  --text: #18241f;
  --text-muted: #5f6a62;
  --text-soft: #7d887f;
  --primary: #d26c45;
  --primary-strong: #b85733;
  --primary-soft: rgba(210, 108, 69, 0.12);
  --shadow: 0 18px 50px rgba(31, 26, 17, 0.1);
  --radius: 14px;
}

html[data-theme='dark'] {
  color-scheme: dark;
  --page-bg: #101513;
  --page-bg-tint: #1a211e;
  --surface: #151b18;
  --surface-2: #1a221e;
  --border: #2b3832;
  --text: #e5ece6;
  --text-muted: #aab6ad;
  --text-soft: #7f8e84;
  --primary: #df7f58;
  --primary-strong: #f0a27f;
  --primary-soft: rgba(223, 127, 88, 0.14);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.32);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background-color: var(--page-bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.65;
  font-size: 1.02rem;
  -webkit-font-smoothing: antialiased;
}

.wrap { width: min(760px, calc(100% - 40px)); margin: 0 auto; }
.wrap-wide { width: min(1040px, calc(100% - 40px)); margin: 0 auto; }

/* ---- Header / nav ---- */
.site-header {
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.site-header .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 0;
  gap: 1rem;
}
.brand { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 800; letter-spacing: -0.01em; color: var(--text); text-decoration: none; font-size: 1.05rem; }
.brand img { width: 26px; height: 26px; }
.nav-links { display: flex; gap: 1.1rem; flex-wrap: wrap; align-items: center; }
.nav-links a { color: var(--text-muted); text-decoration: none; font-weight: 600; font-size: 0.92rem; }
.nav-links a:hover { color: var(--primary-strong); }
.nav-cta { padding: 0.5rem 0.9rem; border-radius: 10px; background: var(--primary); color: #fff !important; }
.nav-cta:hover { background: var(--primary-strong); }

/* ---- Breadcrumb ---- */
.crumb { font-size: 0.86rem; color: var(--text-soft); padding: 1rem 0 0; }
.crumb a { color: var(--text-muted); text-decoration: none; }
.crumb a:hover { color: var(--primary-strong); text-decoration: underline; }
.crumb span[aria-current] { color: var(--text); }

/* ---- Typography ---- */
h1, h2, h3, h4 {
  font-family: 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
  line-height: 1.14;
  color: var(--text);
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2rem, 5.2vw, 3.1rem); margin: 0.6rem 0 0.4rem; }
h2 { font-size: clamp(1.45rem, 3.4vw, 2rem); margin: 2.4rem 0 0.6rem; }
h3 { font-size: 1.2rem; margin: 1.6rem 0 0.4rem; }
p { margin: 0.8rem 0; }
a { color: var(--primary-strong); font-weight: 600; }
.lead { font-size: 1.16rem; color: var(--text); }
.eyebrow { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.78rem; font-weight: 700; color: var(--primary-strong); font-family: Inter, system-ui, sans-serif; }
ul, ol { padding-left: 1.25rem; }
li { margin: 0.35rem 0; }
main { padding: 0 0 4rem; }
section { padding-top: 0.3rem; }

/* ---- CTA ---- */
.cta {
  display: inline-block;
  margin: 0.6rem 0;
  padding: 0.85rem 1.35rem;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  box-shadow: var(--shadow);
  transition: background 0.15s ease, transform 0.15s ease;
}
.cta:hover { background: var(--primary-strong); transform: translateY(-1px); }
.cta-row { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center; margin: 1rem 0; }
.cta-ghost { background: transparent; color: var(--primary-strong); border: 1px solid var(--border); box-shadow: none; }
.cta-ghost:hover { background: var(--primary-soft); }

/* ---- Cards / grid ---- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; margin: 1.4rem 0; }
.card {
  display: block;
  padding: 1.15rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.card:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow); }
.card h3 { margin: 0 0 0.3rem; font-size: 1.1rem; }
.card p { margin: 0; color: var(--text-muted); font-size: 0.94rem; }
.card .tag { display: inline-block; font-family: Inter, sans-serif; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--primary-strong); margin-bottom: 0.4rem; }

/* ---- Callout / feature box ---- */
.callout {
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  margin: 1.4rem 0;
}
.callout h3 { margin-top: 0; }

/* ---- Comparison / data tables ---- */
.table-scroll { overflow-x: auto; margin: 1.2rem 0; }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; background: var(--surface); border-radius: var(--radius); overflow: hidden; }
th, td { text-align: left; padding: 0.7rem 0.85rem; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: var(--surface-2); font-weight: 700; font-family: Inter, sans-serif; }
tr:last-child td { border-bottom: none; }

/* ---- FAQ ---- */
.faq { margin: 1.4rem 0; }
.faq details {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  padding: 0.4rem 1rem;
  margin: 0.6rem 0;
}
.faq summary { cursor: pointer; font-weight: 700; padding: 0.55rem 0; list-style: none; font-family: 'Iowan Old Style', Georgia, serif; font-size: 1.05rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; float: right; color: var(--primary-strong); font-weight: 700; }
.faq details[open] summary::after { content: '\2013'; }
.faq details p { margin: 0.2rem 0 0.7rem; color: var(--text-muted); }

/* ---- Sample RC block ---- */
.sample {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 1.2rem 1.35rem;
  margin: 1.4rem 0;
}
.sample .passage { color: var(--text); }
.sample .q { font-weight: 700; margin-top: 1rem; }
.sample .opts { list-style: upper-alpha; }
.sample .ans { margin-top: 0.6rem; color: var(--primary-strong); font-weight: 600; font-size: 0.95rem; }

/* ---- Hero ---- */
.hero { padding: 2.2rem 0 0.6rem; }
.meta-line { color: var(--text-soft); font-size: 0.85rem; font-family: Inter, sans-serif; margin: 0.3rem 0 0; }

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--page-bg-tint);
  margin-top: 3rem;
  padding: 2.4rem 0;
  font-size: 0.9rem;
}
.foot-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1.5rem; }
.foot-grid h4 { font-family: Inter, sans-serif; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-soft); margin: 0 0 0.6rem; }
.foot-grid a { display: block; color: var(--text-muted); text-decoration: none; font-weight: 500; margin: 0.35rem 0; }
.foot-grid a:hover { color: var(--primary-strong); }
.foot-legal { color: var(--text-soft); margin-top: 1.8rem; font-size: 0.82rem; }

/* ---- Theme toggle ---- */
.theme-toggle {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 30;
  display: grid; width: 2.5rem; height: 2.5rem; place-items: center;
  cursor: pointer; border-radius: 12px; border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  color: var(--text); box-shadow: var(--shadow); backdrop-filter: blur(12px);
}
.theme-toggle span { grid-area: 1 / 1; font-size: 0.95rem; font-weight: 700; transition: opacity 0.18s ease, transform 0.18s ease; }
html[data-theme='dark'] .tt-light, html:not([data-theme='dark']) .tt-dark { opacity: 0; transform: scale(0.75); }
html[data-theme='dark'] .tt-dark, html:not([data-theme='dark']) .tt-light { opacity: 1; transform: scale(1); }

@media (max-width: 560px) {
  .nav-links .nav-hide { display: none; }
}
