/*
 * TMG Nigeria — institutional design system
 * Colours: deep purple (genuine TMG brand #872185), gold (Nigeria), light grey text
 */
:root {
  --brand-900: #4d1049;
  --brand-800: #5e1459;
  --brand-700: #872185;
  --brand-600: #9b2e99;
  --brand-100: #f0e2ef;
  --brand-50: #f8f1f7;
  --gold: #d4a017;
  --gold-light: #e8c25a;
  --ink: #1a2430;
  --ink-soft: #44536a;
  --paper: #f7f5f0;
  --white: #ffffff;
  --line: #e2e0d8;
  --radius: 10px;
  --shadow: 0 4px 18px rgba(77, 16, 73, 0.08);
  --shadow-lg: 0 12px 40px rgba(77, 16, 73, 0.14);
  --font-display: "Georgia", "Times New Roman", serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--white);
  line-height: 1.6;
  font-size: 16px;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand-700); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--brand-900); line-height: 1.25; margin: 0 0 0.5rem; }
h1 { font-size: 2.4rem; }
h2 { font-size: 1.9rem; }
h3 { font-size: 1.35rem; }
p { margin: 0 0 1rem; }
.container { max-width: 1240px; margin: 0 auto; padding: 0 24px; }
.section { padding: 3.5rem 0; }
.section-alt { background: var(--paper); }
.section-green { background: var(--brand-900); color: var(--white); }
.section-green h2, .section-green h3 { color: var(--white); }
.lead { font-size: 1.15rem; color: var(--ink-soft); }

/* Header */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { height: 52px; width: auto; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; color: var(--brand-900); line-height: 1.15; }
.brand-name small { display: block; font-size: 0.72rem; color: var(--ink-soft); font-weight: 400; letter-spacing: 0.06em; text-transform: uppercase; }
.nav { display: flex; gap: 2px; align-items: center; flex-wrap: nowrap; }
.nav a { color: var(--ink); font-size: 0.875rem; font-weight: 500; padding: 8px 9px; border-radius: 6px; white-space: nowrap; }
.nav a:hover, .nav a.active { background: var(--brand-50); color: var(--brand-800); text-decoration: none; }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; font-size: 1.2rem; cursor: pointer; }

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--brand-900) 0%, var(--brand-800) 55%, var(--brand-700) 100%);
  color: var(--white);
  padding: 4.5rem 0;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  right: -120px; top: -120px;
  width: 420px; height: 420px;
  background: radial-gradient(circle, rgba(212, 160, 23, 0.35) 0%, transparent 70%);
  border-radius: 50%;
}
.hero h1 { color: var(--white); font-size: 2.8rem; max-width: 760px; }
.hero p { color: rgba(255,255,255,0.85); font-size: 1.2rem; max-width: 680px; }
.hero .container { position: relative; z-index: 2; }
.hero-badge {
  display: inline-block; background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.25);
  color: var(--gold-light); padding: 4px 14px; border-radius: 999px; font-size: 0.8rem;
  letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 1rem;
}

/* Buttons */
.btn {
  display: inline-block; background: var(--gold); color: var(--brand-900);
  padding: 12px 26px; border-radius: 8px; font-weight: 600; border: none; cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { background: var(--gold-light); color: var(--brand-900); text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-outline { background: transparent; border: 1.5px solid rgba(255,255,255,0.6); color: var(--white); }
.btn-outline:hover { background: rgba(255,255,255,0.1); color: var(--white); }
.btn-green { background: var(--brand-800); color: var(--white); }
.btn-green:hover { background: var(--brand-700); color: var(--white); }

/* Stats band */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 24px; }
.stat { text-align: center; }
.stat .num { font-family: var(--font-display); font-size: 2.6rem; font-weight: 700; color: var(--gold); }
.stat .label { color: rgba(255,255,255,0.85); font-size: 0.95rem; }

/* Cards */
.card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.card-body { padding: 1.4rem; display: flex; flex-direction: column; flex: 1; }
.card-body h3 { font-size: 1.15rem; }
.card-body p { color: var(--ink-soft); font-size: 0.95rem; flex: 1; }
.card-meta { font-size: 0.8rem; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.4rem; }
.card-thumb { aspect-ratio: 16/9; background: var(--brand-100); object-fit: cover; width: 100%; }
.card-thumb--square { aspect-ratio: 1/1; }
.card-thumb--logo { aspect-ratio: 4/3; object-fit: contain; padding: 18px; background: var(--white); }
.grid { display: grid; gap: 24px; }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }

/* Page hero (inner pages) */
.page-hero { background: var(--brand-900); color: var(--white); padding: 2.8rem 0; }
.page-hero h1 { color: var(--white); margin: 0; }
.page-hero p { color: rgba(255,255,255,0.8); max-width: 720px; margin: 0.6rem 0 0; }
.breadcrumb { font-size: 0.85rem; color: rgba(255,255,255,0.7); margin-bottom: 0.6rem; }
.breadcrumb a { color: var(--gold-light); }

/* Content typography */
.prose { max-width: 800px; }
.prose h2 { margin-top: 1.8rem; }
.prose ul, .prose ol { margin: 0 0 1rem; padding-left: 1.4rem; }
.prose li { margin-bottom: 0.5rem; }

/* Timeline */
.timeline { position: relative; margin: 1.5rem 0; padding-left: 28px; }
.timeline::before { content: ""; position: absolute; left: 8px; top: 6px; bottom: 6px; width: 2px; background: var(--brand-100); }
.timeline-item { position: relative; margin-bottom: 1.6rem; }
.timeline-item::before {
  content: ""; position: absolute; left: -24px; top: 6px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--gold); border: 2px solid var(--white); box-shadow: 0 0 0 2px var(--brand-700);
}
.timeline-year { font-family: var(--font-display); font-weight: 700; color: var(--brand-800); font-size: 1.1rem; }

/* Search / filter bar */
.filter-bar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 1.6rem; }
.filter-bar input[type="search"], .filter-bar select {
  padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; font-size: 0.95rem;
  background: var(--white); min-width: 240px;
}
.filter-bar input:focus, .filter-bar select:focus { outline: 2px solid var(--brand-700); outline-offset: 1px; }

/* Forms */
.form-group { margin-bottom: 1.1rem; }
.form-group label { display: block; font-weight: 600; margin-bottom: 0.3rem; font-size: 0.92rem; }
.form-group input, .form-group textarea, .form-group select {
  width: 100%; padding: 11px 14px; border: 1px solid var(--line); border-radius: 8px; font-size: 1rem; font-family: inherit;
}
.form-group input:focus, .form-group textarea:focus { outline: 2px solid var(--brand-700); outline-offset: 1px; }
.form-group [aria-invalid="true"] { border-color: #a33a2e; }
.field-error { color: #8c2f25; font-size: 0.85rem; margin-top: 0.3rem; }

/* Messages */
.messages { margin-bottom: 1.4rem; }
.message { padding: 12px 16px; border-radius: 8px; margin-bottom: 0.6rem; font-weight: 500; }
.message.success { background: var(--brand-100); color: var(--brand-900); }
.message.error { background: #fdecea; color: #a33a2e; }

/* Gallery */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.gallery-summary { color: var(--ink-soft); margin: -0.4rem 0 2.2rem; }
.gallery-collection { margin: 0 0 3.2rem; }
.gallery-collection-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 1rem; border-bottom: 1px solid var(--line); padding-bottom: 0.75rem; }
.gallery-collection-heading h2 { margin-bottom: 0; }
.gallery-count { color: var(--ink-soft); font-size: 0.85rem; white-space: nowrap; }
.gallery-item { margin: 0; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); position: relative; background: var(--white); border: 1px solid var(--line); }
.gallery-image-link { display: block; overflow: hidden; background: var(--brand-50); }
.gallery-image-link:hover { text-decoration: none; }
.gallery-item img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.gallery-image-link:hover img { transform: scale(1.02); }
.gallery-item img { transition: transform 0.2s ease; }
.gallery-caption { padding: 12px 14px 14px; background: var(--white); font-size: 0.85rem; color: var(--ink-soft); }
.gallery-caption strong { display: block; color: var(--ink); font-size: 0.95rem; line-height: 1.35; }
.gallery-caption p { margin: 0.45rem 0 0; }
.gallery-meta { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; margin-top: 0.65rem; font-size: 0.76rem; }
.gallery-meta time, .gallery-meta span { color: var(--ink-soft); }

/* Partners */
.partner-logo { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; align-items: center; justify-content: center; min-height: 110px; }
.partner-logo img { max-height: 64px; object-fit: contain; }
.partner-logo span { font-family: var(--font-display); color: var(--ink-soft); font-weight: 700; text-align: center; }

/* CTA band */
.cta-band { background: var(--gold); color: var(--brand-900); padding: 2.6rem 0; text-align: center; }
.cta-band h2 { color: var(--brand-900); }
.cta-band p { max-width: 640px; margin: 0 auto 1.4rem; }
.cta-band .btn { background: var(--brand-900); color: var(--white); }
.cta-band .btn:hover { background: var(--brand-700); color: var(--white); }
.source-link { margin-top: 1.4rem; padding: 0.8rem 1rem; background: var(--brand-50); border-left: 3px solid var(--brand-700); }

/* Footer */
.site-footer { background: var(--brand-900); color: rgba(255,255,255,0.8); padding: 3rem 0 1.6rem; }
.site-footer h4 { color: var(--white); font-size: 1rem; margin-bottom: 1rem; }
.site-footer a { color: rgba(255,255,255,0.8); }
.site-footer a:hover { color: var(--gold-light); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1.4fr; gap: 30px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.15); margin-top: 2rem; padding-top: 1.2rem; font-size: 0.85rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.social-links { display: flex; gap: 10px; flex-wrap: wrap; }
.social-links a {
  display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 34px;
  border: 1px solid rgba(255,255,255,0.3); border-radius: 50%; font-size: 0.9rem; padding: 0 8px;
}
.social-links a:hover { border-color: var(--gold); color: var(--gold); text-decoration: none; }

/* Tables */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; background: var(--white); }
table.data th, table.data td { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: left; font-size: 0.95rem; }
table.data th { background: var(--brand-50); color: var(--brand-900); font-weight: 600; }

/* Skip link for accessibility */
.skip-link { position: absolute; left: -9999px; top: 0; background: var(--gold); color: var(--brand-900); padding: 10px 16px; z-index: 100; border-radius: 0 0 8px 0; font-weight: 600; }
.skip-link:focus { left: 0; }

/* Utility */
.text-center { text-align: center; }
.mt-2 { margin-top: 1.2rem; }
.mb-0 { margin-bottom: 0; }
.eyebrow { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--gold); font-weight: 700; }
.eyebrow--green { color: var(--brand-700); }
.tag { display: inline-block; background: var(--brand-100); color: var(--brand-800); border-radius: 999px; padding: 3px 12px; font-size: 0.78rem; font-weight: 600; }
.tag-gold { background: #faf0d7; color: #8a6510; }

/* Responsive */
@media (max-width: 1080px) {
  .nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--white); border-bottom: 1px solid var(--line); flex-direction: column; padding: 12px 20px; }
  .nav.open { display: flex; }
  .nav-toggle { display: block; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  h1 { font-size: 2rem; }
  .hero h1 { font-size: 2.1rem; }
  .hero { padding: 3rem 0; }
  .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .container { padding-left: 18px; padding-right: 18px; }
  .grid-3, .grid-4, .footer-grid, .grid-2 { grid-template-columns: 1fr; }
  .brand-name { font-size: 1rem; }
}
