/*
Theme Name: South Africa Insights
Theme URI: https://southafricainsights.example
Author: South Africa Insights
Author URI: https://southafricainsights.example
Description: A clean, original informational-portal theme for South Africa Insights. Built for clarity, readability and responsive performance. Original design and implementation.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: za-insights
*/

/* ---------------------------------------------------------
   Brand palette
   Navy    : #0B2A4A
   Deep    : #12385F
   Sky     : #1B4E86
   Orange  : #E97B2E
   Light   : #F5F7FA
   Border  : #E3E8EF
   Text    : #1F2937
   Muted   : #64748B
   --------------------------------------------------------- */

:root {
  --brand-navy: #0B2A4A;
  --brand-deep: #12385F;
  --brand-sky: #1B4E86;
  --brand-orange: #E97B2E;
  --brand-orange-dark: #C9651F;
  --bg: #F5F7FA;
  --panel: #FFFFFF;
  --border: #E3E8EF;
  --text: #1F2937;
  --muted: #64748B;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(11, 42, 74, .08);
  --maxw: 1160px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, "Inter", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand-sky); text-decoration: none; }
a:hover { color: var(--brand-orange-dark); }

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

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px;
  font-weight: 600; font-size: 15px; border: 2px solid transparent;
  cursor: pointer; transition: background .2s ease, transform .1s ease, color .2s ease, border-color .2s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-orange { background: var(--brand-orange); color: #fff; }
.btn-orange:hover { background: var(--brand-orange-dark); color: #fff; }
.btn-navy { background: var(--brand-navy); color: #fff; }
.btn-navy:hover { background: var(--brand-deep); color: #fff; }
.btn-outline { background: #fff; color: var(--brand-navy); border-color: var(--brand-navy); }
.btn-outline:hover { background: var(--brand-navy); color: #fff; }
.btn-ghost { background: transparent; color: var(--brand-sky); border-color: var(--brand-sky); }
.btn-ghost:hover { background: var(--brand-sky); color: #fff; }

/* ---------------------------------------------------------
   Top bar
   --------------------------------------------------------- */
.topbar { background: var(--brand-navy); color: #CDD9E8; font-size: 13px; }
.topbar .container { display: flex; justify-content: space-between; align-items: center; min-height: 38px; gap: 12px; flex-wrap: wrap; }
.topbar a { color: #CDD9E8; }
.topbar a:hover { color: #fff; }
.topbar .soc { display: flex; gap: 14px; }

/* ---------------------------------------------------------
   Header
   --------------------------------------------------------- */
.site-header { background: #fff; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 40; }
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 24px; height: 68px; }
.brand { display: flex; align-items: baseline; gap: 8px; font-weight: 800; }
.brand .site-title { font-size: 21px; letter-spacing: -.4px; color: var(--brand-navy); }
.brand .site-title a { color: var(--brand-navy); }
.brand .brand-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--brand-orange); }
.primary-nav ul { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; }
.primary-nav li a { display: block; padding: 10px 14px; font-weight: 600; color: var(--brand-navy); border-radius: 8px; font-size: 15px; }
.primary-nav li a:hover, .primary-nav li.current-menu-item a { background: #EEF4FA; color: var(--brand-orange-dark); }
.nav-toggle { display: none; background: none; border: none; font-size: 26px; cursor: pointer; color: var(--brand-navy); }

/* ---------------------------------------------------------
   Hero
   --------------------------------------------------------- */
.hero { padding: 56px 0 34px; text-align: center; }
.hero .eyebrow { display: inline-block; color: var(--brand-orange); font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; font-size: 13px; margin-bottom: 10px; }
.hero h1 { font-size: clamp(32px, 5vw, 48px); line-height: 1.15; margin: 0 0 16px; color: var(--brand-navy); letter-spacing: -.8px; }
.hero p { font-size: clamp(16px, 2.4vw, 19px); color: var(--muted); max-width: 720px; margin: 0 auto 26px; }
.hero .lead { max-width: 760px; }
.hero-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ---------------------------------------------------------
   Feature banner
   --------------------------------------------------------- */
.feature { margin: 18px auto 0; }
.feature-card {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  background: linear-gradient(180deg, var(--brand-sky), var(--brand-deep));
  border-radius: 20px; overflow: hidden; box-shadow: var(--shadow);
}
.feature-card .fc-visual { position: relative; min-height: 240px; background: rgba(255,255,255,.06); }
.feature-card .fc-visual svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.feature-card .fc-visual img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.feature-card .fc-body { padding: 34px 34px; color: #EAF1F8; display: flex; flex-direction: column; justify-content: center; }
.feature-card .fc-tag { align-self: flex-start; background: var(--brand-orange); color: #fff; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; padding: 5px 12px; border-radius: 999px; margin-bottom: 16px; }
.feature-card h2 { color: #fff; font-size: 26px; margin: 0 0 12px; line-height: 1.25; }
.feature-card p { color: #D3E0EC; margin: 0 0 20px; }
.feature-card .fc-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------------------------------------------------------
   Section headers
   --------------------------------------------------------- */
.section { padding: 44px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 26px; }
.section-head h2 { font-size: clamp(24px, 3.4vw, 32px); margin: 0; color: var(--brand-navy); letter-spacing: -.5px; }
.section-head .section-sub { color: var(--muted); margin: 6px 0 0; }
.section-head .viewall { font-weight: 600; white-space: nowrap; }

/* ---------------------------------------------------------
   Cards grid
   --------------------------------------------------------- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card-thumb { aspect-ratio: 16 / 9; background: linear-gradient(135deg, #1B4E86, #0B2A4A); position: relative; overflow: hidden; }
.card-thumb svg { width: 100%; height: 100%; }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-body { padding: 20px; display: flex; flex-direction: column; flex: 1; }
.card-body .catpill { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--brand-orange-dark); margin-bottom: 10px; }
.card-body h3 { font-size: 19px; margin: 0 0 8px; }
.card-body h3 a { color: var(--brand-navy); }
.card-body h3 a:hover { color: var(--brand-orange-dark); }
.card-body p { color: var(--muted); margin: 0; }
.card-metaline { display: flex; gap: 14px; margin-top: 16px; font-size: 13px; color: var(--muted); }

/* ---------------------------------------------------------
   Category grid
   --------------------------------------------------------- */
.catgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.catcard {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px;
  display: flex; flex-direction: column; transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.catcard:hover { border-color: var(--brand-orange); box-shadow: var(--shadow); transform: translateY(-3px); }
.catcard .catcard-thumb { display: block; width: 100%; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; margin-bottom: 16px; }
.catcard .catcard-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.catcard .cat-icon { width: 46px; height: 46px; border-radius: 12px; background: #EEF4FA; display: flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.catcard .cat-icon svg { width: 26px; height: 26px; }
.catcard h3 { font-size: 20px; margin: 0 0 8px; color: var(--brand-navy); }
.catcard p { color: var(--muted); margin: 0 0 18px; font-size: 15px; flex: 1; }
.catcard ul { list-style: none; margin: 0 0 18px; padding: 0; }
.catcard ul li { font-size: 14px; color: var(--text); padding: 4px 0 4px 20px; position: relative; }
.catcard ul li::before { content: ""; position: absolute; left: 0; top: 11px; width: 8px; height: 8px; border-radius: 50%; background: var(--brand-orange); }
.catcard .btn { align-self: flex-start; }

/* ---------------------------------------------------------
   CTA band
   --------------------------------------------------------- */
.cta { margin-top: 20px; }
.cta-inner {
  background: linear-gradient(135deg, #12385F, #1B4E86);
  border-radius: 22px; color: #fff; padding: 46px; text-align: center;
}
.cta-inner h2 { color: #fff; font-size: clamp(24px, 3.4vw, 32px); margin: 0 0 10px; }
.cta-inner p { color: #D3E0EC; max-width: 620px; margin: 0 auto 22px; }
.cta-social { display: flex; gap: 12px; justify-content: center; margin-top: 8px; }
.cta-social a { width: 44px; height: 44px; border-radius: 50%; background: rgba(255,255,255,.12); display: flex; align-items: center; justify-content: center; color: #fff; }
.cta-social a:hover { background: rgba(255,255,255,.25); }

/* ---------------------------------------------------------
   Content page (single / page)
   --------------------------------------------------------- */
.content-wrap { max-width: 800px; margin: 0 auto; padding: 40px 20px; }
.page-hero { background: #fff; border-bottom: 1px solid var(--border); padding: 42px 0; }
.page-hero .container, .page-hero .content-wrap { padding-bottom: 0; }
.breadcrumb { font-size: 13px; color: var(--muted); margin-bottom: 18px; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--brand-orange-dark); }
.breadcrumb .sep { margin: 0 6px; color: #B9C3CE; }
.entry-title { color: var(--brand-navy); font-size: clamp(28px, 4vw, 38px); line-height: 1.2; margin: 0 0 14px; letter-spacing: -.5px; }
.entry-meta { display: flex; gap: 16px; color: var(--muted); font-size: 14px; flex-wrap: wrap; }
.entry-body { font-size: 17px; color: #2B3646; }
.single-thumb { margin: 22px 0 8px; border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); }
.single-thumb img { width: 100%; height: auto; display: block; }
.entry-body h2 { color: var(--brand-navy); font-size: 26px; margin: 34px 0 12px; }
.entry-body h3 { color: var(--brand-navy); font-size: 21px; margin: 28px 0 10px; }
.entry-body p { margin: 0 0 18px; }
.entry-body ul, .entry-body ol { margin: 0 0 18px; padding-left: 24px; }
.entry-body li { margin-bottom: 8px; }
.entry-body table { width: 100%; border-collapse: collapse; margin: 0 0 22px; font-size: 16px; }
.entry-body th, .entry-body td { border: 1px solid var(--border); padding: 11px 14px; text-align: left; }
.entry-body th { background: #F0F5FA; color: var(--brand-navy); }
.entry-body a { text-decoration: underline; }
.entry-body img { border-radius: 10px; margin: 10px 0; }
.entry-body blockquote { border-left: 4px solid var(--brand-orange); margin: 0 0 18px; padding: 4px 0 4px 18px; color: var(--muted); font-style: italic; }

/* Related / grid small */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }

/* Site link block */
.about-block { background: var(--brand-navy); color: #CDD9E8; border-radius: 18px; padding: 34px; margin-top: 34px; }
.about-block h2 { color: #fff; margin-top: 0; }
.about-block a { color: #fff; text-decoration: underline; }

/* ---------------------------------------------------------
   Footer
   --------------------------------------------------------- */
.site-footer { background: var(--brand-navy); color: #B6C5D7; margin-top: 40px; }
.footer-cta { background: linear-gradient(135deg, #12385F, #1B4E86); padding: 44px 0; text-align: center; color: #fff; }
.footer-cta h2 { color: #fff; margin: 0 0 8px; font-size: clamp(22px, 3vw, 28px); }
.footer-cta p { color: #D3E0EC; margin: 0 0 20px; }
.footer-main { padding: 44px 0 20px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 30px; }
.footer-grid h4 { color: #fff; font-size: 15px; margin: 0 0 16px; }
.footer-grid a { color: #B6C5D7; }
.footer-grid a:hover { color: #fff; }
.footer-brand .site-title { font-size: 22px; color: #fff; font-weight: 800; margin: 0 0 10px; }
.footer-brand p { font-size: 14px; max-width: 300px; }
.footer-nav ul { list-style: none; margin: 0; padding: 0; }
.footer-nav li { margin-bottom: 10px; font-size: 14px; }
.footer-social { display: flex; gap: 12px; margin-top: 8px; }
.footer-social a { width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,.1); display: flex; align-items: center; justify-content: center; color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding: 18px 0; font-size: 13px; color: #93A6BB; }
.footer-bottom .container { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.footer-bottom .footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-bottom a { color: #93A6BB; }
.footer-bottom a:hover { color: #fff; }

/* ---------------------------------------------------------
   Lists / archive / empty
   --------------------------------------------------------- */
.archive-title { font-size: clamp(26px, 3.6vw, 34px); color: var(--brand-navy); margin: 0 0 4px; }
.archive-desc { color: var(--muted); max-width: 640px; }
.pagination { display: flex; gap: 8px; justify-content: center; margin: 30px 0; }
.pagination a, .pagination span { padding: 8px 14px; border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--brand-navy); font-weight: 600; }
.pagination .current { background: var(--brand-navy); color: #fff; border-color: var(--brand-navy); }

.search-form { display: flex; max-width: 560px; margin: 0 auto; }
.search-form input[type=search] { flex: 1; padding: 13px 16px; border: 1px solid var(--border); border-radius: 999px 0 0 999px; font-size: 15px; }
.search-form button { padding: 13px 24px; border: none; background: var(--brand-orange); color: #fff; border-radius: 0 999px 999px 0; font-weight: 700; cursor: pointer; }

/* ---------------------------------------------------------
   Responsive
   --------------------------------------------------------- */
@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
  .cards, .catgrid { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .feature-card { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .primary-nav ul { display: none; }
  .primary-nav.open ul { display: flex; flex-direction: column; position: absolute; left: 0; right: 0; top: 68px; background: #fff; border-bottom: 1px solid var(--border); padding: 12px; gap: 2px; }
  .nav-toggle { display: block; }
  .cards, .catgrid, .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero { padding: 40px 0 24px; }
  .section-head { flex-direction: column; align-items: flex-start; }
}
