/* EGCC GivingSpace portal look: white, Raleway, black buttons, dark footer.
   Event pages override the tokens below through :root variables (themecss). */
:root {
  --bg: #f4f4f4; --surface: #fff; --text: #1a1a1a; --muted: #6b6b6b;
  --primary: #111; --primary-text: #fff; --accent: #2f4057; --match: #9a9a9a;
  --font-display: 'Raleway', sans-serif;
  --font-body: 'Raleway', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.portal { font-family: var(--font-body); background: var(--bg); color: var(--text); min-height: 100vh; display: flex; flex-direction: column; -webkit-font-smoothing: antialiased; }
main { flex: 1; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; width: 100%; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; }
h1 { font-size: 1.9rem; margin: 18px 0 8px; }
h2 { font-size: 1.2rem; margin: 26px 0 8px; }
h3 { font-size: 1.05rem; margin: 18px 0 6px; }
p { line-height: 1.55; margin: 8px 0; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.center { text-align: center; }
.notice { background: #fff7e0; border: 1px solid #f0d78a; padding: 12px 14px; border-radius: 6px; margin: 14px 0; }
.notice.ok { background: #eef8ee; border-color: #b9dcb9; }
.notice.err { background: #fdecec; border-color: #f2b5b5; }

.site-header { background: var(--surface); border-bottom: 1px solid #e6e6e6; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.site-header .brand img { height: 40px; display: block; }
.site-header nav { display: flex; gap: 18px; align-items: center; font-size: 0.85rem; letter-spacing: 0.08em; text-transform: uppercase; }
.site-header nav a { text-decoration: none; }

.btn { display: inline-block; background: var(--primary); color: var(--primary-text); padding: 10px 22px; border: 0; border-radius: 3px; text-decoration: none; font: inherit; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; font-size: 0.85rem; cursor: pointer; }
.btn.big { padding: 14px 34px; font-size: 0.95rem; }
.btn.secondary { background: #e8e8e8; color: var(--text); }
.btn:disabled { opacity: 0.5; cursor: default; }

.site-footer { background: #272727; color: #eee; padding: 26px 0 34px; text-align: center; font-size: 0.85rem; margin-top: 40px; }
.site-footer a { color: #fff; }
.site-footer .copy { margin-top: 8px; color: #bbb; }

/* Portal home */
.hero { padding: 30px 0 10px; }
.hero p { color: var(--muted); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin: 8px 0 20px; }
.card { background: var(--surface); border: 1px solid #e6e6e6; border-radius: 6px; overflow: hidden; text-decoration: none; display: flex; flex-direction: column; }
.card .cover { aspect-ratio: 16 / 9; background: #ddd center / cover no-repeat; }
.card .cover.placeholder { background: linear-gradient(135deg, #e9e9e9, #d6d6d6); }
.card .body { padding: 12px 14px 14px; }
.card h3 { margin: 0 0 4px; font-size: 1.02rem; }
.card .meta { color: var(--muted); font-size: 0.88rem; }
.card .amount { margin-top: 8px; font-weight: 600; }
.row-between { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; }
.filter select { font: inherit; padding: 6px 8px; margin-left: 6px; }

/* Project detail */
.project-page { padding-bottom: 30px; }
.project-head { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-top: 22px; }
@media (max-width: 760px) { .project-head { grid-template-columns: 1fr; } .head-media { order: -1; } }
.head-text h1 { margin-top: 6px; }
.tagline { color: var(--accent); font-weight: 600; margin-bottom: 8px; }
.org-logo { max-height: 60px; max-width: 200px; object-fit: contain; display: block; margin-bottom: 8px; }
.meta { color: var(--muted); font-size: 0.92rem; margin: 3px 0; }
.meta.links a { margin-right: 12px; }
.chips { margin: 10px 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: #eee; border-radius: 3px; padding: 2px 8px; font-size: 0.8rem; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; margin: 12px 0; }
.facts .lbl { display: block; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.facts .val { font-weight: 600; }
.progress-wrap { margin: 10px 0 16px; }
.progress { height: 10px; background: #e4e4e4; border-radius: 5px; overflow: hidden; }
.progress > div { height: 100%; background: var(--accent); }
.progress-lbl { display: flex; justify-content: space-between; font-size: 0.85rem; color: var(--muted); margin-top: 4px; }
.head-media img, .head-media video { width: 100%; border-radius: 6px; display: block; background: #000; }
.embed { position: relative; padding-top: 56.25%; }
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: 6px; }
.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid #ddd; margin: 26px 0 10px; }
.tabs a { padding: 10px 14px; text-decoration: none; white-space: nowrap; color: var(--muted); border-bottom: 3px solid transparent; }
.tabs a.active { color: var(--text); border-bottom-color: var(--accent); }
.tab p { white-space: normal; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; margin: 16px 0; }
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 4px; display: block; }
img.wide { width: 100%; border-radius: 6px; margin: 12px 0; }
.people { display: grid; gap: 14px; }
.person { display: flex; gap: 14px; align-items: flex-start; }
.person img, .person .avatar { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; background: #ddd; flex: 0 0 auto; }
.person .name { font-weight: 600; }
.person .title { color: var(--muted); font-size: 0.9rem; }
.goals { padding-left: 20px; }
.goals li { margin: 8px 0; }
.org-head { display: flex; gap: 16px; align-items: center; margin-top: 16px; }
.docs { list-style: none; }
.docs li { padding: 8px 0; border-bottom: 1px solid #eee; }
.update, .qa { padding: 14px 0; border-bottom: 1px solid #eee; }

/* Forms */
.form-page { max-width: 720px; }
.form-page.narrow { max-width: 460px; }
.stack label { display: block; margin: 12px 0 4px; font-size: 0.9rem; color: var(--muted); }
.stack input, .stack textarea, .stack select { display: block; width: 100%; font: inherit; padding: 10px 12px; border: 1px solid #ccc; border-radius: 4px; margin-top: 4px; background: #fff; color: var(--text); }
.stack .btn { margin-top: 18px; }
.link-box { background: #fff; border: 1px solid #ddd; border-radius: 4px; padding: 10px; word-break: break-all; font-family: monospace; }
.lbl { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-top: 10px; }

/* My pledges */
.mine-page { max-width: 640px; padding-top: 10px; }
.mine-card { background: var(--surface); border: 1px solid #e6e6e6; border-radius: 8px; padding: 18px; margin: 16px 0; }
.mine-head { display: flex; gap: 14px; align-items: center; }
.mine-head .logo { height: 48px; }
.mine-head h1 { margin: 0; }
.mine-card table { width: 100%; border-collapse: collapse; margin: 14px 0; }
.mine-card th, .mine-card td { padding: 8px 6px; border-bottom: 1px solid #eee; text-align: left; }
.mine-card .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mine-card tfoot td { font-weight: 700; border-top: 2px solid var(--text); border-bottom: 0; }
.mine-card .status { font-weight: 600; }
.identity .row { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.identity .qr { width: 140px; height: 140px; }
.identity .code { font-family: monospace; font-size: 1.6rem; letter-spacing: 0.1em; }
.identity .link { word-break: break-all; font-size: 0.85rem; }
