/*
Theme Name: Karoep General Engineering
Theme URI: https://karoepgeneralengineering.com
Author: Karoep General Engineering Limited
Author URI: https://karoepgeneralengineering.com
Description: Custom SEO and speed optimised WordPress theme for Karoep General Engineering Limited — a Mombasa-based multidisciplinary engineering firm specialising in tank construction, oil & gas terminals, marine works, fabrication and general construction across East Africa. Built lightweight, framework-free, and tuned for Core Web Vitals.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
Tested up to: 6.6
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: karoep
Tags: custom-background, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready

Karoep General Engineering Theme is distributed under the terms of the GNU GPL.
*/

/* ==========================================================================
   Design tokens
   -------------------------------------------------------------------------
   Palette pulled from the company's own field: steel-plate navy, safety
   orange (matches the Karoep logo), rust/oxide accent, sand, and a warm
   off-white borrowed from site-drawing paper. Type pairs a condensed
   industrial display face with a clean technical body face and a mono
   face reserved for specs, coordinates and codes — the vocabulary of an
   engineering data sheet.
   ========================================================================== */

:root{
  --navy-900:#0b2545;
  --navy-800:#123566;
  --navy-700:#1d4e89;
  --steel-500:#4a6fa1;
  --steel-200:#c7d4e3;
  --orange-600:#e8621a;
  --orange-500:#f1793a;
  --sand-200:#e7ddc7;
  --sand-100:#f2ede0;
  --paper-50:#f7f5f0;
  --ink-900:#161a1f;
  --ink-700:#3a4249;
  --white:#ffffff;
  --line:#dcd6c8;

  --font-display: 'Oswald', 'Arial Narrow', sans-serif;
  --font-body: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'IBM Plex Mono', 'SFMono-Regular', Consolas, monospace;

  --container: 1240px;
  --radius: 2px;
  --shadow-1: 0 1px 3px rgba(11,37,69,.08), 0 6px 20px rgba(11,37,69,.06);
}

/* ==========================================================================
   Reset / base
   ========================================================================== */

*, *::before, *::after{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
body{
  margin:0;
  font-family: var(--font-body);
  color: var(--ink-900);
  background: var(--paper-50);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
img{ max-width:100%; height:auto; display:block; }
a{ color: inherit; text-decoration:none; }
ul{ margin:0; padding:0; list-style:none; }
h1,h2,h3,h4{
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: .01em;
  color: var(--navy-900);
  line-height: 1.15;
  margin: 0 0 .5em;
}
p{ margin: 0 0 1em; }
button{ font-family: inherit; }

:focus-visible{
  outline: 3px solid var(--orange-600);
  outline-offset: 2px;
}

.screen-reader-text{
  position:absolute !important;
  width:1px;height:1px;
  overflow:hidden;
  clip:rect(1px,1px,1px,1px);
  white-space:nowrap;
}
.skip-link{
  position:absolute;
  left:-9999px;
  top:0;
  z-index:100000;
  background:var(--navy-900);
  color:#fff;
  padding:.75em 1.25em;
}
.skip-link:focus{ left: 10px; top: 10px; }

.container{
  max-width: var(--container);
  margin-inline:auto;
  padding-inline: 24px;
}

.eyebrow{
  font-family: var(--font-mono);
  font-size: .8rem;
  letter-spacing:.12em;
  text-transform: uppercase;
  color: var(--orange-600);
  display:flex;
  align-items:center;
  gap:.6em;
  margin-bottom:.9em;
}
.eyebrow::before{
  content:"";
  width:22px;height:2px;
  background: var(--orange-600);
  display:inline-block;
}

.btn{
  display:inline-flex;
  align-items:center;
  gap:.5em;
  font-family: var(--font-mono);
  font-size:.85rem;
  letter-spacing:.06em;
  text-transform:uppercase;
  padding: .95em 1.6em;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor:pointer;
  transition: transform .15s ease, background-color .15s ease, color .15s ease, border-color .15s ease;
}
.btn-primary{ background: var(--orange-600); color:#fff; }
.btn-primary:hover{ background:#c94f11; }
.btn-outline{ border-color: rgba(255,255,255,.5); color:#fff; }
.btn-outline:hover{ background: rgba(255,255,255,.12); }
.btn-ghost{ border-color: var(--navy-900); color: var(--navy-900); }
.btn-ghost:hover{ background: var(--navy-900); color:#fff; }

.section{ padding: 88px 0; }
.section-alt{ background: var(--sand-100); }
.section-dark{ background: var(--navy-900); color:#fff; }
.section-dark h2, .section-dark h3{ color:#fff; }

.section-head{
  max-width: 640px;
  margin-bottom: 48px;
}
.section-head.center{ margin-inline:auto; text-align:center; }

.section-title{ font-size: clamp(1.8rem, 3.2vw, 2.6rem); }

/* ==========================================================================
   Header
   ========================================================================== */

.site-header{
  position: sticky;
  top:0;
  z-index: 500;
  background: rgba(247,245,240,.92);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding-block: 14px;
  gap: 24px;
}
.site-branding{ display:flex; align-items:center; gap:.75em; }
.site-branding img{ height: 44px; width:auto; }
.site-title{
  font-family: var(--font-display);
  font-size: 1.15rem;
  text-transform:uppercase;
  letter-spacing:.02em;
  color: var(--navy-900);
  margin:0;
  line-height:1.1;
}
.site-title span{
  display:block;
  font-family: var(--font-mono);
  font-size:.6rem;
  letter-spacing:.14em;
  color: var(--orange-600);
  text-transform:uppercase;
  margin-top:2px;
}

.primary-nav ul{ display:flex; align-items:center; gap: 28px; }
.primary-nav a{
  font-family: var(--font-mono);
  font-size:.82rem;
  letter-spacing:.05em;
  text-transform:uppercase;
  color: var(--ink-700);
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
}
.primary-nav a:hover,
.primary-nav .current-menu-item a{
  color: var(--navy-900);
  border-color: var(--orange-600);
}

.header-cta{ display:flex; align-items:center; gap:16px; }
.header-phone{
  font-family: var(--font-mono);
  font-size:.85rem;
  color: var(--navy-900);
  display:flex;
  align-items:center;
  gap:.5em;
}
.header-phone svg{ width:16px; height:16px; fill: var(--orange-600); }

.menu-toggle{
  display:none;
  background:none;
  border: 1px solid var(--navy-900);
  padding: 8px 10px;
  cursor:pointer;
}
.menu-toggle span{
  display:block;
  width: 20px;
  height: 2px;
  background: var(--navy-900);
  margin: 4px 0;
}

@media (max-width: 900px){
  .primary-nav{
    position:fixed;
    inset: 0 0 0 30%;
    background: var(--navy-900);
    padding: 100px 32px 32px;
    transform: translateX(100%);
    transition: transform .25s ease;
    z-index: 400;
  }
  .primary-nav.is-open{ transform: translateX(0); }
  .primary-nav ul{ flex-direction:column; align-items:flex-start; gap: 22px; }
  .primary-nav a{ color: #fff; font-size:1rem; }
  .menu-toggle{ display:block; }
  .header-phone{ display:none; }
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero{
  position:relative;
  color:#fff;
  background: linear-gradient(160deg, var(--navy-900) 0%, var(--navy-800) 60%, var(--navy-700) 100%);
  overflow:hidden;
}
.hero-media{
  position:absolute; inset:0;
  z-index:0;
}
.hero-media img{
  width:100%; height:100%; object-fit:cover;
  opacity:.34;
}
.hero-grid-overlay{
  position:absolute; inset:0;
  background-image:
    linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 64px 64px;
  z-index:1;
  pointer-events:none;
}
.hero-inner{
  position:relative;
  z-index:2;
  padding: 140px 0 110px;
}
.hero-frame{
  position:relative;
  padding: 40px;
  border: 1px solid rgba(255,255,255,.28);
  max-width: 760px;
}
.hero-frame::before,.hero-frame::after,
.hero-corner-b::before,.hero-corner-b::after{
  content:"";
  position:absolute;
  width: 26px; height: 26px;
  border: 2px solid var(--orange-600);
}
.hero-frame::before{ top:-2px; left:-2px; border-right:none; border-bottom:none; }
.hero-frame::after{ top:-2px; right:-2px; border-left:none; border-bottom:none; }
.hero-corner-b{ position:absolute; inset:0; }
.hero-corner-b::before{ bottom:-2px; left:-2px; top:auto; border-right:none; border-top:none; }
.hero-corner-b::after{ bottom:-2px; right:-2px; top:auto; border-left:none; border-top:none; }

.hero-badge{
  font-family: var(--font-mono);
  font-size:.78rem;
  letter-spacing:.1em;
  text-transform:uppercase;
  color: var(--sand-200);
  border: 1px solid rgba(255,255,255,.35);
  padding: 6px 12px;
  display:inline-block;
  margin-bottom: 22px;
}
.hero h1{
  color:#fff;
  font-size: clamp(2.1rem, 5vw, 3.6rem);
  margin-bottom:.4em;
}
.hero h1 em{
  font-style:normal;
  color: var(--orange-500);
}
.hero-lede{
  color: var(--steel-200);
  font-size: 1.05rem;
  max-width: 56ch;
  margin-bottom: 32px;
}
.hero-actions{ display:flex; gap:16px; flex-wrap:wrap; }

.hero-coords{
  position:relative;
  z-index:2;
  font-family: var(--font-mono);
  font-size:.72rem;
  letter-spacing:.08em;
  color: var(--steel-200);
  border-top: 1px solid rgba(255,255,255,.18);
  padding: 18px 0;
  display:flex;
  flex-wrap:wrap;
  gap: 28px;
  text-transform:uppercase;
}
.hero-coords span{ color: var(--orange-500); margin-right:6px; }

/* ==========================================================================
   Stat / data plate strip
   ========================================================================== */

.stat-strip{
  background: var(--navy-800);
  border-top: 1px solid rgba(255,255,255,.1);
}
.stat-grid{
  display:grid;
  grid-template-columns: repeat(4, 1fr);
}
.stat-item{
  padding: 28px 24px;
  border-left: 1px solid rgba(255,255,255,.12);
  color:#fff;
}
.stat-item:first-child{ border-left:none; }
.stat-num{
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--orange-500);
  display:block;
}
.stat-label{
  font-family: var(--font-mono);
  font-size:.72rem;
  letter-spacing:.08em;
  text-transform:uppercase;
  color: var(--steel-200);
}
@media (max-width: 780px){
  .stat-grid{ grid-template-columns: repeat(2,1fr); }
  .stat-item:nth-child(3){ border-left:none; }
}

/* ==========================================================================
   Services / capability matrix
   ========================================================================== */

.cap-grid{
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
.cap-item{
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 32px 26px;
  background: var(--white);
  transition: background-color .15s ease;
}
.cap-item:hover{ background: var(--sand-100); }
.cap-index{
  font-family: var(--font-mono);
  color: var(--orange-600);
  font-size:.8rem;
  display:block;
  margin-bottom: 14px;
}
.cap-icon{ width:34px; height:34px; margin-bottom: 16px; color: var(--navy-900); }
.cap-item h3{
  font-size: 1.02rem;
  margin-bottom:.5em;
}
.cap-item p{ font-size:.92rem; color: var(--ink-700); margin:0; }

@media (max-width: 980px){ .cap-grid{ grid-template-columns: repeat(2,1fr); } }
@media (max-width: 560px){ .cap-grid{ grid-template-columns: 1fr; } }

/* ==========================================================================
   About / overview
   ========================================================================== */

.about-layout{
  display:grid;
  grid-template-columns: .82fr 1fr;
  gap: 64px;
  align-items:center;
}
.about-media{ position:relative; }
.about-media img{ border-radius: var(--radius); }
.about-media-tag{
  position:absolute;
  bottom: -18px;
  left: -18px;
  background: var(--orange-600);
  color:#fff;
  font-family: var(--font-mono);
  font-size:.75rem;
  letter-spacing:.06em;
  text-transform:uppercase;
  padding: 12px 16px;
  max-width: 220px;
}
.about-copy p{ color: var(--ink-700); }
.about-list{ margin-top: 24px; display:grid; gap: 14px; }
.about-list li{
  display:flex;
  gap: 12px;
  font-size:.95rem;
  color: var(--ink-900);
}
.about-list svg{ flex:none; width:18px; height:18px; margin-top:3px; fill: var(--orange-600); }

@media (max-width: 900px){
  .about-layout{ grid-template-columns: 1fr; gap: 40px; }
  .about-media{ max-width: 420px; }
}

/* ==========================================================================
   Field log / projects  — Two‑column card layout
   ========================================================================== */

.log-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  border-top: 1px solid var(--line);
  padding-top: 32px;
}

.log-item {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  padding: 0;
  border-bottom: none;
}

.log-thumb {
  aspect-ratio: 4/3;
  overflow: hidden;
  border-radius: var(--radius) var(--radius) 0 0;
}

.log-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s ease;
}

.log-item:hover .log-thumb img {
  transform: scale(1.05);
}

.log-meta {
  font-family: var(--font-mono);
  font-size: .75rem;
  color: var(--orange-600);
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 12px 16px 4px;
}

.log-meta span {
  display: block;
  color: var(--ink-700);
  margin-top: 4px;
  letter-spacing: .02em;
}

.log-body {
  padding: 0 16px 16px;
}

.log-body h3 {
  font-size: 1.15rem;
  margin-bottom: .4em;
}

.log-body p {
  color: var(--ink-700);
  font-size: .94rem;
  margin: 0;
}

/* Responsive: one column on smaller screens */
@media (max-width: 860px) {
  .log-list {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .log-thumb {
    max-width: 100%;
  }
}

/* ==========================================================================
   Roadmap / future plans
   ========================================================================== */

.roadmap{ display:grid; grid-template-columns: repeat(5,1fr); gap: 0; position:relative; }
.roadmap::before{
  content:"";
  position:absolute;
  top: 17px; left:0; right:0;
  height:1px;
  background: rgba(255,255,255,.2);
}
.road-item{ position:relative; padding-right: 20px; }
.road-dot{
  width: 34px; height:34px;
  border-radius:50%;
  border: 1px solid var(--orange-500);
  display:flex; align-items:center; justify-content:center;
  font-family: var(--font-mono);
  font-size:.78rem;
  margin-bottom: 22px;
  background: var(--navy-900);
  position:relative; z-index:1;
}
.road-item h4{ color:#fff; font-size:.98rem; margin-bottom:.4em; }
.road-item p{ color: var(--steel-200); font-size:.86rem; margin:0; }

@media (max-width: 980px){
  .roadmap{ grid-template-columns: 1fr 1fr; gap: 32px; }
  .roadmap::before{ display:none; }
}
@media (max-width: 560px){ .roadmap{ grid-template-columns: 1fr; } }

/* ==========================================================================
   Team
   ========================================================================== */

.team-grid{ display:grid; grid-template-columns: repeat(4,1fr); gap: 28px; }
.team-card{ text-align:left; }
.team-photo{ aspect-ratio:1; border-radius: var(--radius); overflow:hidden; margin-bottom: 16px; }
.team-photo img{ width:100%; height:100%; object-fit:cover; }
.team-card h3{ font-size:1rem; margin-bottom:.2em; }
.team-role{ font-family: var(--font-mono); font-size:.78rem; color: var(--orange-600); text-transform:uppercase; letter-spacing:.05em; }

@media (max-width: 900px){ .team-grid{ grid-template-columns: repeat(2,1fr); } }

/* ==========================================================================
   CTA band
   ========================================================================== */

.cta-band{
  background: var(--orange-600);
  color:#fff;
  padding: 56px 0;
}
.cta-band-inner{
  display:flex; align-items:center; justify-content:space-between; gap: 24px; flex-wrap:wrap;
}
.cta-band h2{ color:#fff; margin:0; font-size: clamp(1.5rem, 3vw, 2rem); }
.cta-band .btn-ghost{ border-color:#fff; color:#fff; }
.cta-band .btn-ghost:hover{ background:#fff; color: var(--orange-600); }

/* ==========================================================================
   Contact
   ========================================================================== */

.contact-layout{ display:grid; grid-template-columns: 1fr 1fr; gap: 56px; }
.contact-card{
  background: var(--white);
  border: 1px solid var(--line);
  padding: 32px;
}
.contact-row{ display:flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.contact-row:last-child{ border-bottom:none; }
.contact-row svg{ width:20px; height:20px; fill: var(--orange-600); flex:none; margin-top:2px; }
.contact-row strong{ display:block; font-size:.78rem; text-transform:uppercase; letter-spacing:.05em; color: var(--ink-700); font-family: var(--font-mono); margin-bottom:2px; }
.contact-map{ border: 1px solid var(--line); overflow:hidden; min-height: 340px; }
.contact-map iframe{ width:100%; height:100%; min-height:340px; border:0; display:block; }

@media (max-width: 900px){ .contact-layout{ grid-template-columns: 1fr; } }

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer{ background: var(--navy-900); color: var(--steel-200); padding-top: 64px; }
.footer-grid{ display:grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px; padding-bottom: 48px; border-bottom: 1px solid rgba(255,255,255,.1); }
.footer-brand img{ height: 40px; margin-bottom: 16px; }
.footer-brand p{ color: var(--steel-200); font-size:.9rem; max-width: 34ch; }
.footer-col h5{ font-family: var(--font-mono); font-size:.75rem; letter-spacing:.1em; text-transform:uppercase; color:#fff; margin-bottom: 18px; }
.footer-col ul{ display:grid; gap: 10px; }
.footer-col a{ font-size:.9rem; color: var(--steel-200); transition: color .15s; }
.footer-col a:hover{ color: var(--orange-500); }
.footer-bottom{ display:flex; justify-content:space-between; align-items:center; padding: 24px 0; flex-wrap:wrap; gap: 12px; font-size:.8rem; font-family: var(--font-mono); }

@media (max-width: 900px){ .footer-grid{ grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px){ .footer-grid{ grid-template-columns: 1fr; } }

/* ==========================================================================
   Generic page/post content (for non-front-page templates)
   ========================================================================== */

.page-hero{ background: var(--navy-900); color:#fff; padding: 70px 0; }
.page-hero h1{ color:#fff; margin:0; }
.entry-content{ padding: 64px 0; max-width: 780px; margin-inline:auto; }
.entry-content h2{ margin-top: 1.4em; }
.entry-content img{ border-radius: var(--radius); margin: 1.2em 0; }
.entry-content a{ color: var(--orange-600); text-decoration: underline; }

.breadcrumbs{
  font-family: var(--font-mono);
  font-size:.78rem;
  color: var(--steel-200);
  text-transform:uppercase;
  letter-spacing:.05em;
  margin-top: 10px;
}
.breadcrumbs a{ color: var(--steel-200); }
.breadcrumbs a:hover{ color:#fff; }

/* Utility */
.text-center{ text-align:center; }
.mt-0{ margin-top:0; }

/* ==========================================================================
   Blog grid (home & archive)
   ========================================================================== */

.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

.blog-grid-full {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.blog-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-1);
  transition: transform .2s ease, box-shadow .2s ease;
  display: flex;
  flex-direction: column;
}

.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(11,37,69,.12);
}

.blog-thumb {
  aspect-ratio: 16/9;
  overflow: hidden;
}

.blog-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s ease;
}

.blog-card:hover .blog-thumb img {
  transform: scale(1.04);
}

.blog-content {
  padding: 18px 20px 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.blog-date {
  font-family: var(--font-mono);
  font-size: .7rem;
  text-transform: uppercase;
  color: var(--orange-600);
  letter-spacing: .06em;
  margin-bottom: 8px;
}

.blog-content h3 {
  font-size: 1.1rem;
  margin-bottom: 0.6em;
}

.blog-content h3 a {
  color: var(--navy-900);
  text-decoration: none;
}

.blog-content h3 a:hover {
  color: var(--orange-600);
}

.blog-content p {
  color: var(--ink-700);
  font-size: .9rem;
  margin-bottom: 1.2em;
  flex: 1;
}

.btn-small {
  padding: 0.6em 1.2em;
  font-size: .75rem;
  align-self: flex-start;
}

.pagination {
  margin-top: 48px;
  text-align: center;
  font-family: var(--font-mono);
}

.pagination .page-numbers {
  display: inline-block;
  padding: 6px 14px;
  margin: 0 2px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink-700);
}

.pagination .page-numbers.current {
  background: var(--navy-900);
  color: #fff;
  border-color: var(--navy-900);
}

.pagination .page-numbers:hover:not(.current) {
  background: var(--sand-100);
}

@media (max-width: 860px) {
  .blog-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  .blog-grid,
  .blog-grid-full {
    grid-template-columns: 1fr;
  }
}