/*
Theme Name: AFR OPES Group
Theme URI: https://opesafrica.com
Author: OPES Group
Description: Dark, minimalist consultancy theme for AFR OPES Group — energy, infrastructure, and policy advisory across Ghana and the wider African region.
Version: 2.0
Text Domain: opes-africa
*/

/* ============================================
   DESIGN TOKENS
   Background:      #0A0A0A  (near-black)
   Panel:            #141412  (raised panel)
   Line:             #262420  (hairline dividers)
   Text primary:     #EDEAE3  (warm off-white)
   Text muted:       #8C887F  (secondary text)
   Gold accent:      #B9975B  (muted antique gold — not neon)
   Gold dim:         #6E5A34  (gold at low opacity contexts)
   ============================================ */

:root {
  --bg: #0A0A0A;
  --panel: #141412;
  --line: #262420;
  --text: #EDEAE3;
  --muted: #8C887F;
  --gold: #B9975B;
  --gold-dim: #6E5A34;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  --maxw: 1120px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; overflow-x: hidden; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.6;
  margin: 0;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Locks background scrolling while the mobile menu panel is open, so the
   page underneath can't shift or peek through behind it on touch devices. */
body.nav-open { overflow: hidden; }

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

a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: 0.01em;
  margin: 0 0 0.4em;
  color: var(--text);
}

h1 { font-size: clamp(2.6rem, 6vw, 4.6rem); font-weight: 300; line-height: 1.05; }
h2 { font-size: clamp(1.9rem, 3.4vw, 2.8rem); font-weight: 300; }
h3 { font-size: 1.35rem; font-weight: 400; }

p { color: var(--muted); font-weight: 300; }

.eyebrow {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1.1em;
}

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 32px;
}

@media (max-width: 480px) {
  .wrap { padding: 0 20px; }
}

.hairline {
  border: none;
  border-top: 1px solid var(--line);
  margin: 0;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line);
}
/*
  The frosted-glass background lives on ::before, not on .site-header
  itself. backdrop-filter (like transform/filter) turns the element it's
  set on into the "containing block" for any position:fixed descendant —
  so with it set directly on .site-header, the mobile nav panel nested
  inside would size itself against the header's own 76px-tall box instead
  of the real viewport (the bug behind the menu rendering half-covered
  with page text showing through it). Isolating the blur to a decorative
  ::before layer keeps .site-header itself free of that property, so the
  nested fixed nav panel correctly sizes against the full viewport again.
*/
.site-header::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: -1;
  background: rgba(10,10,10,0.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}
.brand {
  font-family: var(--serif);
  font-size: 1.35rem;
  letter-spacing: 0.04em;
  color: var(--text);
  white-space: nowrap;
}
.brand span { color: var(--gold); }
.main-nav ul {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 2.4rem;
  margin: 0;
  padding: 0;
}
.main-nav a {
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.25s ease;
  -webkit-tap-highlight-color: transparent;
}
.main-nav a:hover,
.main-nav a.current { color: var(--gold); }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 10px;
  margin: -10px 0 -10px -10px;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
}

@media (max-width: 840px) {
  .main-nav {
    position: fixed;
    top: 76px;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    background: var(--bg);
    display: none;
    flex-direction: column;
    padding: 40px 32px calc(40px + env(safe-area-inset-bottom, 0px));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }
  .main-nav.open { display: flex; }
  .main-nav ul { flex-direction: column; align-items: stretch; gap: 1.6rem; }
  .main-nav a { display: block; padding: 6px 0; font-size: 1rem; }
  .nav-toggle { display: block; }
}

/* ---------- Hero ---------- */
.hero {
  padding: 140px 0 110px;
  text-align: center;
  border-bottom: 1px solid var(--line);
}
.hero p.lede {
  max-width: 620px;
  margin: 1.6rem auto 2.4rem;
  font-size: 1.08rem;
}

@media (max-width: 700px) {
  .hero { padding: 90px 0 70px; }
}
.btn {
  display: inline-block;
  padding: 14px 34px;
  border: 1px solid var(--gold-dim);
  color: var(--gold);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: all 0.3s ease;
}
.btn:hover { background: var(--gold); color: var(--bg); border-color: var(--gold); }

/* ---------- Sections ---------- */
.section { padding: 96px 0; border-bottom: 1px solid var(--line); }
.section-head { max-width: 640px; margin-bottom: 3.4rem; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }

/* ---------- Pillars / Cards ---------- */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.grid-3 .card { background: var(--bg); padding: 44px 38px; }
.card .num { font-family: var(--serif); font-size: 0.95rem; color: var(--gold-dim); margin-bottom: 1.2rem; letter-spacing: 0.05em;}
.card h3 { margin-bottom: 0.7rem; }
.card p { font-size: 0.94rem; margin: 0; }

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

/* ---------- Service list ---------- */
.service-row {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 40px;
  padding: 40px 0;
  border-bottom: 1px solid var(--line);
}
.service-row:last-child { border-bottom: none; }
.service-row .tag {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  padding-top: 0.4rem;
}
.service-row ul { margin: 0.8rem 0 0; padding: 0; list-style: none; }
.service-row li {
  color: var(--muted);
  font-size: 0.95rem;
  padding: 6px 0;
  border-top: 1px solid var(--line);
}
.service-row li:first-child { border-top: none; }

@media (max-width: 700px) {
  .service-row { grid-template-columns: 1fr; gap: 12px; }
}

/* ---------- Projects ---------- */
.project-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.project-card { background: var(--bg); padding: 40px; }
.project-card .status {
  display: inline-block;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bg);
  background: var(--gold);
  padding: 4px 10px;
  margin-bottom: 1rem;
}
.project-card .status.planned { background: transparent; color: var(--gold); border: 1px solid var(--gold-dim); }
.project-card h3 { margin-bottom: 0.5rem; }
.project-card .loc { color: var(--muted); font-size: 0.82rem; letter-spacing: 0.04em; margin-bottom: 0.9rem; }
.project-card p { font-size: 0.92rem; }

@media (max-width: 700px) { .project-grid { grid-template-columns: 1fr; } }

/* ---------- Locations strip ---------- */
.locations {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem 4rem;
  padding: 30px 24px;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
}
.locations strong { color: var(--gold); font-weight: 400; }

@media (max-width: 480px) {
  .locations { gap: 0.8rem 2rem; letter-spacing: 0.12em; }
}

/* ---------- Footer ---------- */
.site-footer { padding: 70px 0 40px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; margin-bottom: 50px; }
.footer-grid h4 { font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); font-family: var(--sans); margin-bottom: 1.1rem; }
.footer-grid p, .footer-grid a { font-size: 0.9rem; color: var(--muted); }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: 0.6rem; }
.footer-bottom { display: flex; justify-content: space-between; font-size: 0.76rem; color: var(--muted); padding-top: 28px; border-top: 1px solid var(--line); }

@media (max-width: 700px) {
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; gap: 0.6rem; }
}

/* ---------- Philosophy callout ---------- */
.philosophy-block {
  border-left: 2px solid var(--gold-dim);
  padding: 4px 0 4px 30px;
  margin: 2.6rem 0 3.2rem;
}
.philosophy-block .eyebrow { margin-bottom: 0.6em; }
.philosophy-block p {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.25rem;
  line-height: 1.5;
  color: var(--text);
  font-weight: 400;
  margin: 0;
}

/* ---------- Address & map ---------- */
.office-address {
  display: block;
  font-style: normal;
  font-family: var(--serif);
  font-size: 1.3rem;
  color: var(--text);
  line-height: 1.5;
  margin: 0 0 2.2rem;
}
.map-frame {
  width: 100%;
  height: 320px;
  border: 1px solid var(--line);
  filter: grayscale(85%) contrast(1.05) brightness(0.92);
  transition: filter 0.4s ease;
}
.map-frame:hover { filter: grayscale(30%) contrast(1.02) brightness(1); }

@media (max-width: 700px) {
  .map-frame { height: 260px; }
}

/* ---------- Contact form ---------- */
.contact-form input, .contact-form textarea {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text);
  font-family: var(--sans);
  font-weight: 300;
  padding: 14px 16px;
  margin-bottom: 16px;
  font-size: 0.95rem;
}
.contact-form input:focus, .contact-form textarea:focus { outline: 1px solid var(--gold); border-color: var(--gold); }
.contact-form label { font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); display: block; margin-bottom: 6px; }

/* ---------- Opes Directory (classic blog style) ---------- */
.directory-list { max-width: 720px; }
.directory-entry { padding: 0 0 2.6rem; }
.directory-entry .eyebrow { margin-bottom: 0.9em; }
.directory-entry h2 {
  font-size: clamp(1.5rem, 2.6vw, 2.1rem);
  margin-bottom: 0.9rem;
}
.directory-entry h2 a { transition: color 0.25s ease; }
.directory-entry h2 a:hover { color: var(--gold); }
.directory-excerpt p {
  font-size: 1rem;
  line-height: 1.75;
  margin: 0 0 1.2rem;
}
.directory-more {
  display: inline-block;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  border-bottom: 1px solid var(--gold-dim);
  padding-bottom: 2px;
  transition: border-color 0.25s ease;
}
.directory-more:hover { border-color: var(--gold); }
.directory-divider { margin: 0 0 2.6rem; }
.directory-entry:last-of-type + .directory-divider { display: none; }

.directory-pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.2rem;
  margin-top: 1rem;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
}
.directory-pagination .page-numbers {
  color: var(--muted);
  padding: 6px 4px;
}
.directory-pagination a.page-numbers:hover,
.directory-pagination .page-numbers.current { color: var(--gold); }

@media (max-width: 700px) {
  .directory-entry h2 { font-size: 1.5rem; }
}

/* ---------- Proposals (Opes publications) ---------- */
.proposal-list { max-width: 720px; }
.proposal-entry { padding: 0 0 2.2rem; }
.proposal-entry .eyebrow { margin-bottom: 0.7em; }
.proposal-entry h2 {
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
  margin-bottom: 0.7rem;
}
.proposal-entry h2 a { transition: color 0.25s ease; }
.proposal-entry h2 a:hover { color: var(--gold); }
.proposal-excerpt p {
  font-size: 0.98rem;
  line-height: 1.7;
  margin: 0 0 1.1rem;
}
.proposal-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.4rem;
}
.proposal-download {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-size: 0.76rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--bg);
  background: var(--gold);
  padding: 10px 18px;
  transition: background 0.25s ease;
}
.proposal-download:hover { background: var(--text); }
.proposal-more {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.25s ease;
}
.proposal-more:hover { color: var(--gold); }
.proposal-divider { margin: 0 0 2.2rem; }
.proposal-entry:last-of-type + .proposal-divider { display: none; }

.proposal-body p { font-size: 1rem; line-height: 1.75; }
.proposal-download-block { margin: 2.4rem 0 0; }

@media (max-width: 700px) {
  .proposal-entry h2 { font-size: 1.4rem; }
  .proposal-actions { gap: 1rem; }
}

/* ---------- News ticker ---------- */
.news-ticker {
  display: flex;
  align-items: center;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  white-space: nowrap;
  height: 30px;
}
.ticker-track {
  display: flex;
  width: max-content;
  padding-left: 20px;
  animation: opes-ticker-scroll 65s linear infinite;
}
/*
  Scoped to devices with a real hover-capable pointer (mouse/trackpad)
  only. Without this guard, touchscreens fire a synthetic ":hover" the
  moment someone taps a headline and never clear it — since there's no
  mouse to "leave" — which is why the ticker appeared to freeze/stop
  running on mobile after the first tap. Desktop keeps the hover-to-pause
  behaviour; mobile now scrolls continuously.
*/
@media (hover: hover) and (pointer: fine) {
  .ticker-track:hover { animation-play-state: paused; }
}
.ticker-content {
  display: flex;
  align-items: center;
  height: 30px;
}
.ticker-item {
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  font-size: 0.76rem;
  text-decoration: none;
  transition: color 0.25s ease;
}
.ticker-item:hover { color: var(--gold); }
.ticker-source {
  color: var(--gold);
  font-size: 0.6rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-right: 6px;
}
.ticker-sep { color: var(--line); margin: 0 16px; font-size: 0.7rem; }

@keyframes opes-ticker-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* Accessibility */
a:focus-visible, button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
