/* ============================================================
   SGA & Associates — Site Stylesheet
   Palette: navy / cream / gold — deliberately restrained and
   professional (per firm's ICAI compliance requirement: no
   flashy/promotional styling, no blinking CTAs, no pop-ups
   other than the mandatory disclaimer gate).
   ============================================================ */

:root {
  /* Matched to the CPV Desk app palette for a consistent brand look */
  --navy: #0f2138;
  --navy-dark: #0a1828;
  --navy-soft: #16324f;
  --gold: #a97a2f;
  --gold-soft: #c99a4f;
  --cream: #f6f3ec;
  --paper: #fffdf8;
  --ink: #22201b;
  --ink-soft: #5b5850;
  --border: #e2dccb;
  --max-width: 1140px;
  --radius: 4px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Source Sans 3", "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--cream);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: "Playfair Display", Georgia, "Times New Roman", serif;
  color: var(--navy);
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 0.6em;
}

h1 { font-size: clamp(2rem, 4vw, 2.75rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1em; color: var(--ink-soft); }

a { color: var(--navy); }

img { max-width: 100%; display: block; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Top utility bar ---------- */

.top-bar {
  background: var(--navy-dark);
  color: #c9d1e0;
  font-size: 0.82rem;
}
.top-bar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 24px;
  gap: 16px;
  flex-wrap: wrap;
}
.top-bar a { color: #dfe5ee; text-decoration: none; }
.top-bar a:hover { color: var(--gold-soft); }
.top-bar-links { display: flex; gap: 20px; flex-wrap: wrap; }
.top-bar-note { letter-spacing: 0.04em; font-size: 0.78rem; color: #93a0b5; }

@media (max-width: 700px) {
  .top-bar-note { display: none; }
}

/* ---------- Header / Nav ---------- */

.site-header {
  background: var(--paper);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
}

.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-logo { flex: none; }

.brand-text { display: flex; flex-direction: column; line-height: 1.15; }

.brand-mark {
  font-family: "Playfair Display", serif;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--navy);
  letter-spacing: 0.01em;
}

.brand-sub {
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
  margin-top: 2px;
}

.nav-links {
  display: flex;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  text-decoration: none;
  font-size: 0.95rem;
  color: var(--navy-soft);
  font-weight: 600;
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--navy);
  border-bottom-color: var(--gold);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 10px;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--navy);
  margin: 4px 0;
}

@media (max-width: 800px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    gap: 0;
    display: none;
    padding: 8px 24px 16px;
  }
  .nav-links.open { display: flex; }
  .nav-links li { border-top: 1px solid var(--border); }
  .nav-links a { display: block; padding: 12px 4px; }
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(169,122,47,0.18), transparent 60%),
    linear-gradient(160deg, var(--navy) 0%, var(--navy-dark) 100%);
  color: #fff;
  padding: 96px 24px 80px;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.5;
  background-image:
    linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,0.6), transparent 75%);
  pointer-events: none;
}

.hero .container { max-width: var(--max-width); position: relative; }

.hero h1 { color: #fff; max-width: 720px; }

.hero p.lead {
  color: #d7deea;
  font-size: 1.1rem;
  max-width: 620px;
}

.hero-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.8rem;
  color: var(--gold-soft);
  font-weight: 700;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.hero-eyebrow::before {
  content: "";
  width: 34px;
  height: 1px;
  background: var(--gold-soft);
  display: inline-block;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  padding: 12px 26px;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn-primary {
  background: var(--gold);
  color: var(--navy-dark);
}
.btn-primary:hover { background: var(--gold-soft); }

.btn-outline {
  background: transparent;
  color: #fff;
  border-color: rgba(255,255,255,0.5);
}
.btn-outline:hover { border-color: #fff; }

.btn-outline-navy {
  background: transparent;
  color: var(--navy);
  border-color: var(--navy);
}
.btn-outline-navy:hover { background: var(--navy); color: #fff; }

/* ---------- Sections ---------- */

section { padding: 64px 0; }
section.alt { background: var(--paper); }

.section-head { max-width: 680px; margin-bottom: 36px; }
.section-head .kicker {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 8px;
  display: block;
}

.grid {
  display: grid;
  gap: 28px;
}
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

@media (max-width: 800px) {
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

.card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}

.card h3 { margin-bottom: 10px; }

.icon-badge {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--gold-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  margin-bottom: 16px;
  font-family: "Playfair Display", serif;
}

/* ---------- Team ---------- */

.team-card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-align: left;
}

.team-photo {
  aspect-ratio: 4 / 3;
  background: var(--navy-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.5);
  font-size: 0.85rem;
  overflow: hidden;
}
.team-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.team-body { padding: 20px; }
.team-body .role {
  color: var(--gold);
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
  display: block;
}

/* ---------- Tables (resources / due dates) ---------- */

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--paper);
  font-size: 0.95rem;
}
th, td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
th {
  background: var(--navy);
  color: #fff;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.table-wrap table { border: none; }

/* ---------- Updates / Articles ---------- */

.update-card {
  border-bottom: 1px solid var(--border);
  padding: 26px 0;
}
.update-card:first-child { padding-top: 0; }
.update-date {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gold);
  font-weight: 700;
}
.tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--navy);
  color: #fff;
  padding: 3px 9px;
  border-radius: 20px;
  margin-right: 6px;
}

/* ---------- Forms ---------- */

.form-field { margin-bottom: 18px; }
.form-field label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 6px;
  color: var(--navy);
}
.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.95rem;
  background: #fff;
  color: var(--ink);
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--gold);
}
.form-note {
  font-size: 0.85rem;
  color: var(--ink-soft);
}
.form-status {
  margin-top: 14px;
  font-size: 0.9rem;
  font-weight: 600;
}
.form-status.success { color: #2f7a4c; }
.form-status.error { color: #a5312a; }

/* ---------- Info strip ---------- */

.info-strip {
  background: var(--navy);
  color: #fff;
  padding: 40px 0;
}
.info-strip .grid { text-align: center; }
.info-strip strong { display: block; font-size: 1.6rem; color: var(--gold-soft); font-family: "Playfair Display", serif; }
.info-strip span { font-size: 0.85rem; color: #cfd6e2; }

/* ---------- Footer ---------- */

.site-footer {
  background: var(--navy-dark);
  color: #b9c2d1;
  padding: 48px 0 24px;
  font-size: 0.9rem;
}
.site-footer h4 { color: #fff; font-size: 0.95rem; margin-bottom: 14px; font-family: inherit; }
.site-footer a { color: #b9c2d1; text-decoration: none; }
.site-footer a:hover { color: #fff; }
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.3fr;
  gap: 32px;
  margin-bottom: 32px;
}
@media (max-width: 800px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: 8px; }

.disclaimer-text {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: 20px;
  font-size: 0.78rem;
  color: #8b93a3;
  line-height: 1.7;
}

.copyright {
  margin-top: 16px;
  font-size: 0.78rem;
  color: #6f7889;
}

/* ---------- Disclaimer Gate ---------- */

.disclaimer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 22, 38, 0.92);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.disclaimer-overlay[hidden] { display: none; }

.disclaimer-box {
  background: #fff;
  max-width: 640px;
  width: 100%;
  border-radius: 6px;
  padding: 36px 36px 28px;
  max-height: 86vh;
  overflow-y: auto;
}
.disclaimer-box h2 { font-size: 1.3rem; margin-bottom: 16px; }
.disclaimer-box p { font-size: 0.92rem; }
.disclaimer-actions {
  display: flex;
  gap: 14px;
  margin-top: 24px;
  flex-wrap: wrap;
}

/* ---------- Breadcrumb / page header ---------- */

.page-head {
  background: var(--navy);
  color: #fff;
  padding: 44px 0;
}
.page-head h1 { color: #fff; margin-bottom: 8px; }
.page-head p { color: #c9d1e0; margin: 0; }

/* ---------- Office / presence cards ---------- */

.office-card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  border-top: 3px solid var(--gold);
}
.office-card.is-head { border-top-color: var(--navy); }
.office-card .office-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 10px;
  display: block;
}
.office-card h3 { margin-bottom: 8px; font-size: 1.05rem; }
.office-card address { font-style: normal; color: var(--ink-soft); font-size: 0.92rem; }
.office-card .office-phone { margin-top: 10px; font-size: 0.9rem; font-weight: 600; color: var(--navy); }

/* =========================================================
   Admin panel
   ========================================================= */

.admin-login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--navy-dark);
  padding: 24px;
}
.admin-login-box {
  background: var(--paper);
  border-radius: 6px;
  padding: 40px;
  width: 100%;
  max-width: 380px;
}
.admin-login-box h1 { font-size: 1.3rem; margin-bottom: 4px; }
.admin-login-box .sub { font-size: 0.85rem; color: var(--ink-soft); margin-bottom: 24px; }

.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 230px;
  flex: none;
  background: var(--navy-dark);
  color: #c9d1e0;
  padding: 24px 16px;
}
.admin-sidebar .brand-mark { color: #fff; }
.admin-sidebar-title { font-size: 1.1rem; font-weight: 700; color: #fff; margin-bottom: 2px; font-family: "Playfair Display", serif; }
.admin-sidebar-sub { font-size: 0.72rem; color: #8b93a3; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 28px; }
.admin-nav { list-style: none; margin: 0; padding: 0; }
.admin-nav li { margin-bottom: 2px; }
.admin-nav a {
  display: block;
  padding: 9px 12px;
  border-radius: 4px;
  color: #c9d1e0;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
}
.admin-nav a:hover { background: rgba(255,255,255,0.06); color: #fff; }
.admin-nav a.active { background: var(--gold); color: var(--navy-dark); }
.admin-nav .divider { border-top: 1px solid rgba(255,255,255,0.1); margin: 14px 0; }

.admin-main { flex: 1; background: var(--cream); min-width: 0; }
.admin-topbar {
  background: var(--paper);
  border-bottom: 1px solid var(--border);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.admin-topbar h1 { font-size: 1.3rem; margin: 0; }
.admin-content { padding: 32px; max-width: 900px; }

.admin-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; gap: 12px; flex-wrap: wrap; }

.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; margin-bottom: 32px; }
.stat-card { background: var(--paper); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; }
.stat-card strong { display: block; font-size: 1.8rem; font-family: "Playfair Display", serif; color: var(--navy); }
.stat-card span { font-size: 0.82rem; color: var(--ink-soft); }
.stat-card.warn strong { color: #a5651a; }

.admin-table-wrap { background: var(--paper); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.admin-table-wrap table { font-size: 0.9rem; }
.admin-table-wrap th { background: var(--navy-soft); }
.admin-table-wrap td .muted { color: var(--ink-soft); font-size: 0.82rem; }
.row-actions { display: flex; gap: 10px; }
.row-actions form { margin: 0; }
.link-btn {
  background: none;
  border: none;
  color: var(--navy);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}
.link-btn.danger { color: #a5312a; }

.badge-pill {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 20px;
}
.badge-pill.on { background: #e6efe9; color: #2f7a4c; }
.badge-pill.off { background: #eee9db; color: #8a6d2f; }
.badge-pill.unread { background: #fbe9d0; color: #a5651a; }

.checkbox-row { display: flex; align-items: center; gap: 8px; }
.checkbox-row input { width: auto; }

.admin-alert { padding: 12px 16px; border-radius: 4px; font-size: 0.9rem; margin-bottom: 20px; }
.admin-alert.success { background: #e6efe9; color: #2f6b46; }
.admin-alert.error { background: #f5e6e8; color: #7a2331; }

@media (max-width: 800px) {
  .admin-shell { flex-direction: column; }
  .admin-sidebar { width: 100%; }
  .admin-content { padding: 20px; }
}
