/* =========================================================
   Africa Grains — Universal Styles
   - Tokens (colors, spacing, radii, shadows)
   - Base (reset, typography, links)
   - Layout (container, section, grid)
   - Components (buttons, cards, badges, forms, tables)
   - Media (images, ratios)
   - Utilities (visibility, alignment, spacing)
   - Accessibility (focus, reduced motion)
   ========================================================= */

/* -------- Tokens / CSS Variables -------- */
:root {
    /* Brand (from project brief) */
    --brand-green: #044c26;   /* Main Color in logo */
    --brand-gold:  #c39933;   /* Secondary Color in logo */
    --brand-gold-tr:  #c3983371;  
    --brand-gold-l:  #fdd26e;   /* Secondary Color in logo */

    /* Neutrals */
    --grey-900: #1a1a1a;
    --grey-800: #2a2a2a;
    --grey-700: #4a4a4a;
    --grey-600: #5f5f5f;
    --grey-500: #8a8a8a;
    --grey-300: #e6e6e6;
    --grey-200: #efefef;
    --grey-100: #f7f7f7;
    --white:    #ffffff;
    --trans-500: #1b1b1b4b;

    /* Feedback */
    --success: #2e7d32;
    --warning: #b26a00;
    --error:   #c62828;
    --info:    #1565c0;

    /* Layout */
    --container-max: 100%;    /* page width target */
    --gutter: 0px;             /* page padding */

    /* Spacing (4/8px scale) */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 32px;
    --space-7: 48px;
    --space-8: 64px;
    --space-9: 96px;

    /* Radii & Shadows */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;

    --shadow-xs: 0 1px 2px rgba(0,0,0,.06);
    --shadow-sm: 0 2px 6px rgba(0,0,0,.08);
    --shadow-md: 0 8px 24px rgba(0,0,0,.12);

    --ts-soft:   0 1px 2px rgba(0, 0, 0, .30);
    --ts-strong: 0 2px 6px rgba(0, 0, 0, .40);
    --ts-strong-white: 0 2px 6px rgba(255, 255, 255, 0.603);
    --ts-gold:   0 0 8px rgba(195, 153, 51, .65); /* brand glow */

    /* Typography */
    --text-base: 16px;
    --lh: 1.6;
}

/* -------- Base / Reset -------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font: 400 var(--text-base)/var(--lh) system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    color: var(--grey-900);
    background: var(--white);
}

/* Headings keep semantic order; presentational helpers later if needed */
h1, h2, h3, h4, h5, h6 {
    margin: 0 0 var(--space-4);
    line-height: 1.25;
    font-weight: 800;
    letter-spacing: -0.02em;
}


p {
    margin: 0 0 var(--space-4);
    color: var(--grey-800);
}

small, .small { font-size: 0.875rem; }

.title{
    font-size: 30px;
    margin-bottom: 0;
}
.sub-title{
    margin-top: 0;
    font-size: 30px;
    margin-bottom: 100px;
    color: var(--brand-green);
    padding-bottom: 5px;
    border-bottom-style: solid;
    border-width: 2px;
    border-color: var(--brand-gold);
}

/* Links & Focus states (WCAG AA) */
a {
    color: var(--brand-green);
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}
:where(a, button, input, select, textarea):focus-visible {
    outline: 3px solid var(--brand-gold);
    outline-offset: 2px;
}

/* Lists */
ul, ol { padding-left: 1.25rem; }
li + li { margin-top: .35em; }

/* Body text links */
p a,
li a {
    text-decoration: underline;
    text-underline-offset: 0.15em;
}


/* .section {
    padding-block: var(--space-8);
} */
/* .section--tight {
    padding-block: var(--space-6);
}
.section--loose {
    padding-block: var(--space-9);
} */

/* Grid primitive with responsive modifiers */
.grid {
    display: grid;
    gap: var(--space-5);
}
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--auto { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

@media (max-width: 992px) {
    .grid--3, .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
    .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
}

/* Split (media/content) */
.split {
    display: grid;
    gap: var(--space-6);
    grid-template-columns: 1.2fr 1.2fr;
}
.split.reverse { 
    grid-template-columns: 1.2fr 1.2fr; 
}
.split__media, .split__content { 
    align-self: center; 
}
@media (max-width: 900px) {
    .split, .split.reverse { grid-template-columns: 1fr; }
}

/* -------- Components -------- */

/* Logo */
.logo {
    font-weight: 800;
    text-decoration: none;
    color: var(--grey-900);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    background: var(--grey-200);
    color: var(--grey-900);
    font-weight: 700;
    line-height: 1.1;
    box-shadow: var(--shadow-xs);
    transition: transform .05s ease, filter .2s ease;
}
.btn:hover {
    filter: brightness(1.02);
}
.btn:active {
    transform: translateY(1px);
}
.btn--primary {
    background: var(--brand-green);
    color: var(--white);
}
.btn--secondary {
    background: var(--brand-gold);
    color: var(--grey-900);
}
.btn--ghost {
    background-color: var(--trans-500);
    border-color: var(--grey-800);
    color: var(--grey-900);
}
.btn--block { display: block; width: 100%; }

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--grey-100);
    color: var(--grey-700);
    font-size: 0.8125rem;
    font-weight: 700;
}

/* Cards */
.card {
    background: var(--white);
    border: 1px solid var(--grey-300);
    border-radius: var(--radius-md);
    padding: var(--space-5);
    box-shadow: var(--shadow-xs);
}
.card--elevated {
    box-shadow: var(--shadow-sm);
}

/* Forms (global look; validation handled server-side) */
label {
    display: block;
    font-weight: 700;
    margin: 0 0 var(--space-2);
}
input[type="text"],
input[type="email"],
input[type="tel"],
select,
textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--grey-300);
    border-radius: var(--radius-sm);
    background: var(--white);
    color: var(--grey-900);
    box-shadow: inset 0 1px 1px rgba(0,0,0,.03);
}
textarea { min-height: 120px; }
input::placeholder, textarea::placeholder { color: var(--grey-500); }
/* input:invalid, select:invalid, textarea:invalid { border-color: var(--error); } */
.form-row {
    display: grid;
    /* gap: var(--space-4); */
}
.form-row--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 680px) {
    .form-row--2 { grid-template-columns: 1fr; }
}
.form-help { color: var(--grey-600); font-size: 0.875rem; }
.form-error { color: var(--error); font-weight: 700; }

/* Tables (if needed later) */
.table {
    width: 100%;
    border-collapse: collapse;
}
.table th,
.table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--grey-300);
    text-align: left;
}

/* -------- Media -------- */
img {
    max-width: 100%;
    height: auto;
    display: block;
}
.figure {
    margin: 0;
}
.ratio {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: var(--radius-md);
}
.ratio::before {
    content: "";
    display: block;
    padding-top: 56.25%; /* 16:9 default */
}
.ratio > img,
.ratio > iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* -------- Utilities -------- */
.text-center { text-align: center; }
.text-right  { text-align: right;  }
.m-0 { margin: 0 !important; }
.mt-1 { margin-top: var(--space-1) !important; }
.mt-2 { margin-top: var(--space-2) !important; }
.mt-3 { margin-top: var(--space-3) !important; }
.mt-4 { margin-top: var(--space-4) !important; }
.mt-5 { margin-top: var(--space-5) !important; }
.mb-1 { margin-bottom: var(--space-1) !important; }
.mb-2 { margin-bottom: var(--space-2) !important; }
.mb-3 { margin-bottom: var(--space-3) !important; }
.mb-4 { margin-bottom: var(--space-4) !important; }
.mb-5 { margin-bottom: var(--space-5) !important; }
.p-0 { padding: 0 !important; }
.p-1 { padding: var(--space-1) !important; }
.p-2 { padding: var(--space-2) !important; }
.p-3 { padding: var(--space-3) !important; }
.p-4 { padding: var(--space-4) !important; }
.p-5 { padding: var(--space-5) !important; }

.visually-hidden {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; border: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
    white-space: nowrap;
}

/* -------- Accessibility / Motion -------- */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

/* ============================================================
   Buttons — base + WhatsApp variant
   - Uses brand green; readable on dark and light
============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 8px;
    border: 0;
    text-decoration: none;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: transform .05s ease, box-shadow .2s ease;
}

.btn:focus-visible {
    outline: 3px solid #c39933; /* brand gold focus */
    outline-offset: 2px;
}

.btn:active {
    transform: translateY(1px);
}

/* WhatsApp button (brand-aligned) */
.btn-whatsapp {
    background: #044c26; /* brand green */
    color: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,.12);
}

.btn-whatsapp:hover {
    filter: brightness(1.05);
}

.btn-whatsapp .icon {
    display: inline-block;
    vertical-align: middle;
    fill: currentColor;
}


/* =========================================
   Africa Map — clean styles (map only)
   ========================================= */

/* Container */
/* .route-map { 
    margin: var(--space-8) auto; 
} */
/* List container */
.country-list {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;                    /* consistent spacing */
  list-style: none;
  margin: 0;
  padding: 0;
}
/* Items */
.country-list .country {
    font-size: 20px;
    display: block;              /* full row width */
    line-height: 1.4;            /* stable height */
    transition: font-weight .30s ease, color .15s ease;
}
.country-list .country.is-hover {
  /* font-weight: 800; */
  color: var(--brand-gold);
}
.transport-routes{
    width: 100%;
}
.wrapper-cl{
    width: 100%;
    display: flex;
    flex-direction: column;
}
.wrapper-map{
    margin-bottom: 100px;
    display: flex;
    flex-direction: row;
    align-items: center;
}
/* Match the on-map :hover effect when JS adds a class */
.africa-routes path[data-id].is-hover {
  fill: var(--brand-gold);
}

/* Bold the text item when linked country is hovered */
.country-list .country.is-hover {
  /* font-weight: 800; */
  transform: scale(1.05);
  color: var(--brand-gold);
}

.africa-routes {
    z-index: 5;
  width: 100%;
  height: auto;
  display: block;
  max-width: 1100px;
  margin-inline: auto;
  margin: 0;
}

/* Labels & pins */
.origin-dot { fill: var(--brand-green); }
.origin-label { fill: var(--brand-green); font-size: 12px; font-weight: 600; }
.dest-dot { fill: var(--grey-300); }

/* destination Dot */
.dest-dot{
    fill: var(--brand-green);
}
/* --- Countries (target ONLY country shapes) ---
   All your country paths have data-id (e.g., data-id="ZA"). Routes/pings do NOT.
   So we style countries via [data-id] to avoid touching routes/pings.
*/
.africa-routes path[data-id] {
  fill: #919191;                 /* base land */
  stroke: var(--white);
  stroke-width: 1.2;
  vector-effect: non-scaling-stroke;
  transition: fill .25s, opacity .25s, transform .25s, filter .25s;
}

/* SADC set (gold & full opacity) */
.africa-routes path[data-id].sadc,
.africa-routes path[data-id]#ZA,
.africa-routes path[data-id]#NA,
.africa-routes path[data-id]#BW,
.africa-routes path[data-id]#ZM,
.africa-routes path[data-id]#ZW,
.africa-routes path[data-id]#MZ,
.africa-routes path[data-id]#AO,
.africa-routes path[data-id]#TZ,
.africa-routes path[data-id]#LS,
.africa-routes path[data-id]#SZ,
.africa-routes path[data-id]#CD,
.africa-routes path[data-id]#MW {
/* SADC background */
  fill: var(--brand-gold-tr); 
  opacity: 1;
  cursor: pointer;
}

/* Non-SADC dim */
.africa-routes path[data-id]:not(#ZA):not(#NA):not(#BW):not(#ZM):not(#ZW):not(#MZ):not(#AO):not(#TZ):not(#LS):not(#SZ):not(#CD):not(#MW) {
  opacity: .4;
}


/* Hover only for SADC */
.africa-routes path[data-id]#ZA:hover,
.africa-routes path[data-id]#NA:hover,
.africa-routes path[data-id]#BW:hover,
.africa-routes path[data-id]#ZM:hover,
.africa-routes path[data-id]#ZW:hover,
.africa-routes path[data-id]#MZ:hover,
.africa-routes path[data-id]#AO:hover,
.africa-routes path[data-id]#TZ:hover,
.africa-routes path[data-id]#LS:hover,
.africa-routes path[data-id]#SZ:hover,
.africa-routes path[data-id]#CD:hover,
.africa-routes path[data-id]#MW:hover
{
  fill: var(--brand-gold);
  /* transform: scale(1.001);
  filter: drop-shadow(0 0 4px var(--grey-900)); */
}

/* --- Route lines & pings (ensure always visible) --- */
.route-path {
  fill: none;
  stroke: var(--brand-green);
  stroke-width: 1.5;
  /* marker-end: url(#arrowhead); */
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;           /* for draw animation */
  stroke-dashoffset: 1;
  opacity: 0.50;
  pointer-events: none;          /* don't block hover on countries */
}

/* Arrowhead color */
/* .route-arrow { fill: var(--brand-green); } */

/* Draw animation */
@keyframes route-draw {
  from { stroke-dashoffset: var(--dash, 1); }
  to   { stroke-dashoffset: 5; }
}

/* Ping ripple */
.ping {
  fill: url(#ping-grad);
  transform-origin: center;
  opacity: 0.0;
  animation: ping 1200ms ease-out forwards;
  pointer-events: none;          /* never capture hover */
}
@keyframes ping {
  0%   { opacity: 0.0; r: 0; }
  20%  { opacity: 0.5; }
  100% { opacity: 0.0; r: 22; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .route-path { animation: none !important; stroke-dasharray: none; stroke-dashoffset: 0; }
  .ping { animation: none !important; opacity: 0.25; }
}


@media (max-width: 1080px) {
    .split { grid-template-columns: 1fr; }
}

.legal{
    width: 80%;
    margin-left: 10%;
}