/*
Theme Name: Apps Hub
Theme URI: https://mortgageagent.org
Author: Jae
Description: Minimal theme powering the homepage, support pages, and shared privacy policy for Jae's apps (Mortgage Agent, Currency & Bill Split, and future apps). Each app gets its own Support page template; Privacy Policy is one shared page covering every app.
Version: 1.0
Requires at least: 6.0
Requires PHP: 7.4
*/

:root {
  --bg: #f7f7f4;
  --surface: #ffffff;
  --border: #e5e5e0;
  --ink: #1c1d1f;
  --ink-muted: #5c5e64;
  --accent: #3a5578;
  --accent-soft: #3a557814;
  --danger: #b3402c;
  --danger-soft: #b3402c1c;
  --tag-mortgage: #4b6355;
  --tag-mortgage-soft: #4b635514;
  --tag-currency: #3a5578;
  --tag-currency-soft: #3a557814;
  --font-display: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --font-body: 'Public Sans', system-ui, -apple-system, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131417;
    --surface: #1a1c21;
    --border: #2b2e35;
    --ink: #eeeeee;
    --ink-muted: #9a9ca3;
    --accent: #86a6d8;
    --accent-soft: #86a6d81f;
    --danger: #ff8066;
    --danger-soft: #ff80661c;
    --tag-mortgage: #93b59f;
    --tag-mortgage-soft: #93b59f1f;
    --tag-currency: #86a6d8;
    --tag-currency-soft: #86a6d81f;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #131417;
  --surface: #1a1c21;
  --border: #2b2e35;
  --ink: #eeeeee;
  --ink-muted: #9a9ca3;
  --accent: #86a6d8;
  --accent-soft: #86a6d81f;
  --danger: #ff8066;
  --danger-soft: #ff80661c;
  --tag-mortgage: #93b59f;
  --tag-mortgage-soft: #93b59f1f;
  --tag-currency: #86a6d8;
  --tag-currency-soft: #86a6d81f;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  padding-inline: 20px;
  padding-block: 48px 72px;
}
h1, h2, h3 { font-family: var(--font-display); text-wrap: balance; margin: 0; }
p, li { line-height: 1.65; color: var(--ink); }
a { color: var(--accent); }
img { max-width: 100%; }

.doc { max-width: 720px; margin: 0 auto; }
.wrap { max-width: 1080px; margin: 0 auto; }

/* Masthead (title + last-updated / eyebrow) */
.masthead {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 14px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}
.masthead h1 { font-size: clamp(1.9rem, 4vw, 2.4rem); font-weight: 700; }
.masthead .sub { color: var(--ink-muted); font-size: 1rem; margin-top: 6px; }
.pill-badge {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px;
  white-space: nowrap;
}

.intro { font-size: 1.05rem; color: var(--ink-muted); max-width: 62ch; margin-bottom: 8px; }

/* In-page nav */
nav.toc { display: flex; flex-wrap: wrap; gap: 8px; margin: 28px 0 40px; }
nav.toc a {
  font-size: 0.82rem; font-weight: 600; text-decoration: none;
  color: var(--ink-muted); background: var(--surface);
  border: 1px solid var(--border); border-radius: 999px; padding: 6px 13px;
}
nav.toc a:hover { color: var(--accent); border-color: var(--accent); }

/* Sections */
section.policy-section {
  padding-top: 40px; margin-top: 4px;
  border-top: 1px solid var(--border);
  scroll-margin-top: 20px;
}
section.policy-section:first-of-type { border-top: none; padding-top: 0; }
h2 {
  font-size: 1.35rem; font-weight: 700;
  display: flex; align-items: baseline; gap: 10px;
  margin-bottom: 18px;
}
h2 .num { font-family: var(--font-body); font-size: 0.8rem; font-weight: 700; color: var(--ink-muted); }

/* App-tagged content blocks */
.app-block { border-left: 3px solid var(--border); padding-left: 18px; margin-bottom: 22px; }
.app-block:last-child { margin-bottom: 0; }
.app-block.mortgage { border-left-color: var(--tag-mortgage); }
.app-block.currency { border-left-color: var(--tag-currency); }
.app-block ul { margin: 0; padding-left: 20px; }
.app-block li { margin-bottom: 8px; }
.app-block li:last-child { margin-bottom: 0; }
.app-block p { margin: 0; }
.shared p { color: var(--ink-muted); max-width: 62ch; }

.tag {
  display: inline-block; font-family: var(--font-body);
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 3px 10px; border-radius: 999px; margin-bottom: 10px;
}
.tag.mortgage { color: var(--tag-mortgage); background: var(--tag-mortgage-soft); }
.tag.currency { color: var(--tag-currency); background: var(--tag-currency-soft); }

/* Contact / info cards */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 6px; }
@media (max-width: 600px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 18px 20px;
}
.contact-card h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 4px; }
.contact-card .app-role { font-size: 0.78rem; color: var(--ink-muted); margin-bottom: 12px; }
.contact-row { display: flex; align-items: center; gap: 8px; font-size: 0.92rem; flex-wrap: wrap; }
.contact-row code {
  font-family: ui-monospace, 'SF Mono', Consolas, monospace;
  font-size: 0.82rem; background: var(--accent-soft);
  padding: 3px 8px; border-radius: 6px; word-break: break-all;
}
.copy-btn {
  font-family: var(--font-body); font-size: 0.74rem; font-weight: 600; color: var(--accent);
  background: none; border: 1px solid var(--border); border-radius: 6px;
  padding: 4px 8px; cursor: pointer; flex-shrink: 0;
}
.copy-btn:hover { border-color: var(--accent); }
.placeholder-note { font-size: 0.76rem; color: var(--ink-muted); margin-top: 8px; }

footer.site-footer {
  margin-top: 56px; padding-top: 20px;
  border-top: 1px solid var(--border);
  color: var(--ink-muted); font-size: 0.8rem;
}

/* --- Support-page specific: brand row, notice, faq, form card --- */
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 44px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 16px -6px var(--accent);
}
.brand-mark.mortgage { background: linear-gradient(135deg, var(--tag-mortgage), #7a9686); }
.brand-mark.currency { background: linear-gradient(135deg, var(--tag-currency), #6f8fc4); }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; }
.brand-sub { color: var(--ink-muted); font-size: 0.82rem; }

.grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 56px; align-items: start; }
@media (max-width: 860px) { .grid { grid-template-columns: 1fr; gap: 40px; } }

.eyebrow {
  font-family: var(--font-body); font-weight: 700; font-size: 0.72rem;
  letter-spacing: 0.09em; text-transform: uppercase; color: var(--accent); margin-bottom: 10px;
}

.notice {
  margin-top: 26px; padding: 16px 18px;
  border: 1px solid var(--border); border-left: 3px solid var(--accent);
  border-radius: 10px; background: var(--surface); font-size: 0.92rem; color: var(--ink);
}
.notice strong { font-family: var(--font-display); }

.response-note { margin-top: 18px; color: var(--ink-muted); font-size: 0.92rem; max-width: 48ch; }

.faq { margin-top: 40px; display: grid; gap: 16px; }
.faq-item { padding: 16px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.faq-item h3 { font-size: 0.94rem; font-weight: 700; margin-bottom: 6px; }
.faq-item p { color: var(--ink-muted); font-size: 0.88rem; margin: 0; }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 18px; padding: 28px;
  box-shadow: 0 20px 45px -30px rgba(20, 20, 40, 0.35);
}
.card h2 { font-size: 1.1rem; font-weight: 800; font-family: var(--font-display); margin-bottom: 4px; }
.card .sub { color: var(--ink-muted); font-size: 0.86rem; margin-bottom: 22px; }

label { display: block; font-size: 0.84rem; font-weight: 600; margin-bottom: 7px; }
.req { color: var(--danger); }
.field { margin-bottom: 18px; }
input, textarea, select {
  width: 100%; font-family: var(--font-body); font-size: 0.95rem; color: var(--ink);
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; outline: none; transition: border-color .15s ease, box-shadow .15s ease;
}
textarea { resize: vertical; min-height: 110px; }
input::placeholder, textarea::placeholder { color: var(--ink-muted); opacity: 0.8; }
input:focus, textarea:focus, select:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.error-text { color: var(--danger); font-size: 0.78rem; margin-top: 6px; display: none; }
.field.invalid .error-text { display: block; }
.field.invalid input, .field.invalid textarea { border-color: var(--danger); }

button[type="submit"] {
  width: 100%; font-family: var(--font-display); font-weight: 700; font-size: 0.98rem;
  color: #fff; background: linear-gradient(135deg, var(--tag-currency), #6f8fc4);
  border: none; border-radius: 999px; padding: 14px 20px; cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
}
button[type="submit"]:hover { transform: translateY(-1px); box-shadow: 0 10px 24px -10px var(--accent); }
button[type="submit"]:active { transform: translateY(0); }

.form-note { margin-top: 12px; font-size: 0.78rem; color: var(--ink-muted); text-align: center; }
.sent-banner {
  display: none; margin-top: 14px; padding: 10px 14px; border-radius: 10px;
  background: var(--accent-soft); color: var(--accent); font-size: 0.85rem; font-weight: 600;
}
.sent-banner.show { display: block; }
.sent-banner.error { background: var(--danger-soft); color: var(--danger); }

/* --- Homepage app cards --- */
.app-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 36px; }
@media (max-width: 700px) { .app-cards { grid-template-columns: 1fr; } }
.app-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px;
  padding: 26px; text-decoration: none; display: block;
  transition: transform .15s ease, box-shadow .15s ease;
}
.app-card:hover { transform: translateY(-2px); box-shadow: 0 16px 32px -20px rgba(20,20,40,0.35); }
.app-card h3 { font-size: 1.15rem; font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.app-card p { color: var(--ink-muted); font-size: 0.9rem; margin: 0 0 14px; }
.app-card .link-label { font-size: 0.82rem; font-weight: 700; }
.app-card.mortgage .link-label { color: var(--tag-mortgage); }
.app-card.currency .link-label { color: var(--tag-currency); }
