/* KFE Innovation Hub - mobile-first styles
   Brand: deep navy #0A1F44, gold #C9A227 */
:root {
  --navy: #0A1F44;
  --navy-2: #122B5C;
  --gold: #C9A227;
  --gold-soft: #F5EBCF;
  --ink: #1c2333;
  --muted: #5c6678;
  --bg: #f6f7fb;
  --card: #ffffff;
  --line: #e3e7f0;
  --danger: #b3261e;
  --ok: #1e7e34;
  --radius: 12px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
}
a { color: var(--navy-2); }
img { max-width: 100%; height: auto; display: block; }

/* Header */
.site-header { background: var(--navy); color: #fff; }
.topbar {
  max-width: 1100px; margin: 0 auto; padding: 14px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand a { color: #fff; text-decoration: none; display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 10px; background: var(--gold);
  color: var(--navy); font-weight: 800; display: flex; align-items: center; justify-content: center;
}
.brand-name { font-size: 1.05rem; font-weight: 700; line-height: 1.2; }
.brand-tag { font-size: 0.72rem; color: var(--gold-soft); opacity: 0.85; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.nav a {
  color: #fff; text-decoration: none; padding: 8px 12px; border-radius: 8px; font-size: 0.92rem;
}
.nav a:hover, .nav a.active { background: rgba(255,255,255,0.12); }
.nav a.cta { background: var(--gold); color: var(--navy); font-weight: 700; }
.nav a.cta:hover { background: #d9b23a; }

/* Hero */
.hero { background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 70%); color: #fff; }
.hero-inner { max-width: 1100px; margin: 0 auto; padding: 52px 16px; }
.hero h1 { margin: 0 0 10px; font-size: 1.9rem; line-height: 1.25; }
.hero p { margin: 0 0 20px; max-width: 640px; color: #dbe2f2; }
.hero .gold { color: var(--gold); }

/* Layout */
.wrap { max-width: 1100px; margin: 0 auto; padding: 24px 16px; }
.section-title { font-size: 1.3rem; margin: 28px 0 14px; color: var(--navy); }
.section-title .gold-rule {
  display: block; width: 56px; height: 4px; background: var(--gold); border-radius: 2px; margin-top: 6px;
}

/* Cards */
.grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .grid { grid-template-columns: repeat(3, 1fr); } }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
}
.card-img { aspect-ratio: 16/9; background: #dfe4ef; object-fit: cover; width: 100%; }
.card-img.placeholder {
  display: flex; align-items: center; justify-content: center; color: var(--muted);
  font-size: 0.85rem; background: linear-gradient(135deg, #dfe4ef, #eef1f7);
}
.card-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-body h3 { margin: 0; font-size: 1.05rem; }
.card-body h3 a { color: var(--navy); text-decoration: none; }
.card-body h3 a:hover { text-decoration: underline; }
.card-summary { color: var(--muted); font-size: 0.92rem; margin: 0; flex: 1; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; }
.badge {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.02em;
  padding: 3px 10px; border-radius: 999px; background: #eef1f7; color: var(--navy-2);
}
.badge.stage { background: var(--gold-soft); color: #7a5f10; }
.badge.featured { background: var(--gold); color: var(--navy); }
.card-meta { font-size: 0.8rem; color: var(--muted); }

/* Buttons */
.btn {
  display: inline-block; padding: 10px 18px; border-radius: 10px; border: 0;
  background: var(--navy); color: #fff; font-weight: 700; font-size: 0.95rem;
  text-decoration: none; cursor: pointer; text-align: center;
}
.btn:hover { background: var(--navy-2); }
.btn.gold { background: var(--gold); color: var(--navy); }
.btn.gold:hover { background: #d9b23a; }
.btn.ghost { background: transparent; color: var(--navy); border: 1.5px solid var(--navy); }
.btn.danger { background: var(--danger); }
.btn.small { padding: 6px 12px; font-size: 0.85rem; border-radius: 8px; }

/* Forms */
.form { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-weight: 700; margin-bottom: 6px; font-size: 0.92rem; }
.form-row .hint { font-size: 0.82rem; color: var(--muted); font-weight: 400; }
input[type=text], input[type=password], input[type=email], input[type=url],
select, textarea {
  width: 100%; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 8px;
  font-size: 1rem; font-family: inherit; background: #fff;
}
textarea { min-height: 140px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold); border-color: var(--gold); }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }

/* Search and filters */
.filters {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; display: grid; grid-template-columns: 1fr; gap: 10px; margin: 20px 0;
}
@media (min-width: 700px) { .filters { grid-template-columns: 2fr 1fr 1fr auto; align-items: end; } }

/* Detail pages */
.detail-head { margin-bottom: 16px; }
.detail-head h1 { color: var(--navy); margin: 0 0 8px; font-size: 1.7rem; }
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 16px 0; }
@media (min-width: 700px) { .gallery { grid-template-columns: repeat(3, 1fr); } }
.gallery img { border-radius: 10px; aspect-ratio: 4/3; object-fit: cover; width: 100%; }
.video-block { margin: 16px 0; }
.video-block video, .video-block iframe {
  width: 100%; border-radius: 10px; background: #000; aspect-ratio: 16/9; border: 0;
}
.doc-list { list-style: none; padding: 0; margin: 12px 0; }
.doc-list li {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 14px; margin-bottom: 8px; display: flex; justify-content: space-between;
  align-items: center; gap: 10px; flex-wrap: wrap;
}
.profile-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; display: flex; gap: 16px; align-items: center; flex-wrap: wrap;
}
.profile-card img { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; }
.profile-card .avatar-fallback {
  width: 84px; height: 84px; border-radius: 50%; background: var(--navy); color: var(--gold);
  display: flex; align-items: center; justify-content: center; font-size: 1.8rem; font-weight: 800;
}
.description { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }

/* Tables (admin) */
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
table.admin { width: 100%; border-collapse: collapse; font-size: 0.92rem; min-width: 640px; }
table.admin th, table.admin td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; }
table.admin th { background: var(--navy); color: #fff; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.04em; }
table.admin tr:last-child td { border-bottom: 0; }
.inline-form { display: inline; }
.status-pill { font-size: 0.75rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.status-pill.published, .status-pill.active { background: #dff0e2; color: var(--ok); }
.status-pill.draft, .status-pill.disabled { background: #f3e2e2; color: var(--danger); }

/* Alerts */
.alert { padding: 12px 16px; border-radius: 10px; margin: 16px 0; font-size: 0.95rem; }
.alert.success { background: #dff0e2; color: #14532d; border: 1px solid #bfe3c8; }
.alert.error { background: #fbe4e2; color: #7a1f1a; border: 1px solid #f3c2bd; }
.alert.info { background: #e3ecfb; color: var(--navy); border: 1px solid #c4d4f2; }

/* Admin dashboard stats */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 16px 0; }
@media (min-width: 700px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; text-align: center; }
.stat .num { font-size: 1.8rem; font-weight: 800; color: var(--navy); }
.stat .label { font-size: 0.82rem; color: var(--muted); }

/* Media manager */
.media-row {
  display: flex; gap: 12px; align-items: center; background: var(--card);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin-bottom: 10px; flex-wrap: wrap;
}
.media-thumb { width: 90px; height: 64px; object-fit: cover; border-radius: 8px; background: #dfe4ef; }
.media-info { flex: 1; min-width: 160px; font-size: 0.88rem; }
.media-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* Footer */
.site-footer { background: var(--navy); color: #cfd8ee; margin-top: 48px; }
.footer-inner { max-width: 1100px; margin: 0 auto; padding: 28px 16px; font-size: 0.9rem; }
.footer-inner a { color: var(--gold); }
.empty { color: var(--muted); font-style: italic; }
.two-col { display: grid; grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 860px) { .two-col { grid-template-columns: 2fr 1fr; } }
