/* Resume Workshop — Shared Styles */

:root {
  --primary:        #0d3a6a;
  --primary-dark:   #082855;
  --primary-light:  #dbeafe;
  --secondary:      #147a5e;
  --bg:             #ffffff;
  --bg-alt:         #f8fafc;
  --text:           #0f172a;
  --text-muted:     #475569;
  --border:         #e2e8f0;
  --red-light:      #fef2f2;
  --red:            #dc2626;
  --green-light:    #f0fdf4;
  --green:          #15803d;
  --r-sm:           4px;
  --r-md:           8px;
  --r-pill:         9999px;
  --shadow-sm:      0 1px 3px rgba(0, 0, 0, 0.08);
  --font:           system-ui, -apple-system, 'Segoe UI', 'PingFang TC', 'Microsoft JhengHei', sans-serif;
}

/* ─── Reset ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }

body {
  font-family: var(--font);
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  min-height: 100dvh;
}

img { max-width: 100%; display: block; }
ul, ol { padding-left: 1.5em; }
li { margin-bottom: 0.3em; }
a { color: var(--primary); }
p { margin-bottom: 0.75rem; }
p:last-child { margin-bottom: 0; }

h1 { font-size: 2.25rem;  line-height: 1.2;  font-weight: 800; }
h2 { font-size: 1.75rem;  line-height: 1.25; font-weight: 700; }
h3 { font-size: 1.375rem; line-height: 1.3;  font-weight: 700; }

/* ─── Language Toggle ────────────────────────────── */
body:not(.zh) .zh { display: none !important; }
body.zh      .en  { display: none !important; }

/* ─── Nav ────────────────────────────────────────── */
.app-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1.5rem;
  background: var(--primary);
  color: white;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
  flex-wrap: wrap;
}

.nav-brand { text-decoration: none; color: white; }
.nav-brand-name { font-weight: 800; font-size: 1.1rem; line-height: 1.3; }

.nav-links { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }

.nav-links a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.15s;
}
.nav-links a:hover { color: white; }

/* ─── Language Pill ──────────────────────────────── */
.lang-pill {
  display: flex;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  border-radius: var(--r-pill);
  overflow: hidden;
}

.lang-opt {
  padding: 3px 12px;
  font-size: 0.8rem;
  font-weight: 700;
  background: transparent;
  color: rgba(255, 255, 255, 0.6);
  border: none;
  cursor: pointer;
  font-family: var(--font);
  transition: all 0.15s;
  letter-spacing: 0.03em;
}
.lang-opt.active { background: white; color: var(--primary); }

/* ─── Buttons ────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.125rem;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
  border: 2px solid transparent;
  border-radius: var(--r-sm);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
  line-height: 1.4;
  white-space: nowrap;
  user-select: none;
  -webkit-user-select: none;
}
.btn-lg  { padding: 0.75rem 1.5rem;  font-size: 1.125rem; }
.btn-sm  { padding: 0.3rem  0.75rem; font-size: 0.875rem; }
.btn-xs  { padding: 0.2rem  0.6rem;  font-size: 0.8rem; }

.btn-primary   { background: var(--primary);   color: white; }
.btn-primary:hover:not(:disabled)   { background: var(--primary-dark); }

.btn-secondary { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-secondary:hover:not(:disabled) { background: var(--primary-light); }

.btn-success   { background: var(--secondary); color: white; }
.btn-success:hover:not(:disabled)   { background: #0f6347; }

.btn-ghost     { background: transparent; color: var(--text-muted); border-color: var(--border); }
.btn-ghost:hover:not(:disabled)     { background: var(--bg-alt); color: var(--text); }

.btn-danger    { background: transparent; color: var(--red); border-color: #fca5a5; }
.btn-danger:hover:not(:disabled)    { background: var(--red-light); }

.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ─── Forms ──────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }

label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
  color: var(--text);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 580px) { .form-row { grid-template-columns: 1fr; } }

input[type="text"],
input[type="email"],
input[type="tel"],
textarea {
  width: 100%;
  padding: 0.55rem 0.875rem;
  font-family: var(--font);
  font-size: 1.05rem;
  color: var(--text);
  background: white;
  border: 2px solid var(--border);
  border-radius: var(--r-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
  line-height: 1.5;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(13, 58, 106, 0.12);
}

textarea { resize: vertical; min-height: 80px; }

.helper {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  font-style: italic;
}

/* ─── Checkboxes ─────────────────────────────────── */
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.5rem;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  padding: 0.5rem 0.75rem;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: all 0.15s;
  font-size: 0.9rem;
  line-height: 1.4;
}
.checkbox-label:hover { border-color: var(--primary); background: var(--primary-light); }

.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-width: 16px;
  margin-top: 2px;
  accent-color: var(--primary);
  cursor: pointer;
}
.checkbox-label:has(input:checked) { border-color: var(--primary); background: var(--primary-light); }
.checkbox-label:has(input:checked) span { color: var(--primary); font-weight: 600; }

/* ─── Cards ──────────────────────────────────────── */
.card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

/* ─── Entry block (job / volunteer) ─────────────── */
.entry-block {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.entry-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.entry-block-label {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--primary);
}

/* ─── Print Base ─────────────────────────────────── */
@media print {
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  @page { size: letter; margin: 0.75in; }
}
