/*
Theme Name: MalaCam
Theme URI: https://malacam.com
Author: MalaCam
Author URI: https://malacam.com
Description: Professional custom theme for MalaCam – Bridging Markets. Creating Opportunities.
Version: 1.1
License: GNU General Public License v2 or later
Text Domain: malacam
*/

:root {
  --navy: #0F2C4C;
  --navy-mid: #1F4E79;
  --teal: #0D7377;
  --teal-light: #14919B;
  --gold: #C9A227;
  --bg: #F7F8FA;
  --text: #1E2937;
  --text-muted: #64748B;
  --white: #FFFFFF;
  --border: #E2E8F0;
  --shadow: 0 4px 24px rgba(15, 44, 76, 0.08);
  --radius: 12px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--teal); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--teal-light); }
img { max-width: 100%; height: auto; }
.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* Header */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1000;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
}
.site-logo {
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.5px;
}
.site-logo span { color: var(--teal); }
.main-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 32px;
}
.main-nav a {
  color: var(--navy);
  font-weight: 500;
  font-size: 0.95rem;
  position: relative;
}
.main-nav a:hover,
.main-nav .current-menu-item a {
  color: var(--teal);
  text-decoration: none;
}
.main-nav a::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--teal);
  transition: width 0.2s;
}
.main-nav a:hover::after,
.main-nav .current-menu-item a::after { width: 100%; }
.lang-switch {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}
.lang-switch a { color: var(--navy); margin: 0 4px; }
.lang-switch a:hover { color: var(--teal); }

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 60%, #1a5276 100%);
  color: var(--white);
  padding: 100px 0 90px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 80% 20%, rgba(13,115,119,0.15) 0%, transparent 50%);
  pointer-events: none;
}
.hero h1 {
  font-size: 3.4rem;
  margin: 0 0 12px;
  font-weight: 700;
  letter-spacing: -1px;
  line-height: 1.1;
}
.hero .tagline {
  font-size: 1.35rem;
  margin: 0 0 24px;
  font-weight: 500;
  opacity: 0.95;
}
.hero p {
  max-width: 640px;
  margin: 0 auto 36px;
  font-size: 1.1rem;
  opacity: 0.9;
  line-height: 1.7;
}
.btn {
  display: inline-block;
  padding: 14px 32px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  margin: 0 8px 8px;
  text-decoration: none;
  transition: all 0.2s ease;
}
.btn-primary {
  background: var(--teal);
  color: var(--white);
  box-shadow: 0 4px 14px rgba(13,115,119,0.3);
}
.btn-primary:hover {
  background: var(--teal-light);
  transform: translateY(-1px);
  text-decoration: none;
  color: var(--white);
}
.btn-outline {
  border: 2px solid rgba(255,255,255,0.8);
  color: var(--white);
  background: transparent;
}
.btn-outline:hover {
  background: var(--white);
  color: var(--navy);
  text-decoration: none;
}

/* Sections */
.section { padding: 80px 0; }
.section-alt { background: var(--white); }
.section h2 {
  color: var(--navy);
  font-size: 2.1rem;
  text-align: center;
  margin: 0 0 12px;
  font-weight: 700;
  letter-spacing: -0.5px;
}
.section .section-intro {
  text-align: center;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 48px;
  font-size: 1.05rem;
}
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 28px;
}
.card {
  background: var(--white);
  padding: 36px 28px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
  border: 1px solid var(--border);
  transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(15, 44, 76, 0.12);
}
.card h3 {
  color: var(--navy);
  margin: 0 0 12px;
  font-size: 1.2rem;
}
.card p { font-size: 0.95rem; color: var(--text-muted); margin: 0; }

.steps { max-width: 720px; margin: 0 auto; }
.steps ol {
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.steps li {
  counter-increment: step;
  margin-bottom: 24px;
  padding-left: 56px;
  position: relative;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 36px;
  height: 36px;
  background: var(--teal);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
}
.steps li strong { color: var(--navy); }

.cta-band {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
  color: var(--white);
  text-align: center;
  padding: 72px 24px;
}
.cta-band h2 {
  color: var(--white);
  margin: 0 0 24px;
  font-size: 2rem;
}

/* Page content */
.page-content { padding: 60px 0 80px; }
.page-content h1 {
  color: var(--navy);
  font-size: 2.4rem;
  margin: 0 0 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
}
.page-content h2 { color: var(--navy); font-size: 1.6rem; margin-top: 2em; }
.page-content h3 { color: var(--teal); font-size: 1.2rem; }
.page-content p { margin-bottom: 1.1em; }
.page-content ul, .page-content ol { margin-bottom: 1.4em; padding-left: 1.4em; }
.page-content li { margin-bottom: 0.4em; }

/* Contact form */
.contact-wrapper {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 48px;
  align-items: start;
  margin-top: 32px;
}
.contact-form {
  background: var(--white);
  padding: 40px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.contact-form label {
  display: block;
  margin-bottom: 18px;
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--navy);
}
.contact-form input,
.contact-form select,
.contact-form textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-top: 6px;
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.2s;
}
.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(13,115,119,0.1);
}
.contact-form button {
  background: var(--navy);
  color: var(--white);
  border: none;
  padding: 14px 32px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  transition: background 0.2s;
}
.contact-form button:hover { background: var(--navy-mid); }
.contact-details {
  background: var(--white);
  padding: 36px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.contact-details h3 { margin-top: 0; color: var(--navy); }
.contact-details p { margin: 12px 0; }
.success-msg {
  background: #ecfdf5;
  color: #065f46;
  padding: 14px 18px;
  border-radius: 8px;
  margin-bottom: 24px;
  font-weight: 500;
}

/* Footer */
.site-footer {
  background: var(--navy);
  color: rgba(255,255,255,0.85);
  padding: 56px 0 28px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
  text-align: left;
}
.footer-brand { font-size: 1.4rem; font-weight: 700; color: var(--white); margin-bottom: 12px; }
.footer-brand span { color: var(--teal-light); }
.site-footer a { color: #a8d5d7; }
.site-footer a:hover { color: var(--white); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 20px;
  text-align: center;
  font-size: 0.85rem;
  opacity: 0.7;
}

@media (max-width: 900px) {
  .contact-wrapper { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; text-align: center; }
}
@media (max-width: 768px) {
  .hero { padding: 70px 0 60px; }
  .hero h1 { font-size: 2.4rem; }
  .main-nav ul { gap: 18px; }
  .header-inner { flex-wrap: wrap; gap: 12px; }
  .section { padding: 60px 0; }
  .btn { display: block; margin: 8px auto; max-width: 240px; }
}

/* Hero with image */
.hero-content {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
  text-align: left;
}
.hero-text h1 { font-size: 3.2rem; }
.hero-image img {
  width: 100%;
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}
.card-icon {
  width: 80px;
  height: 80px;
  object-fit: contain;
  margin-bottom: 16px;
  border-radius: 12px;
}

@media (max-width: 900px) {
  .hero-content { grid-template-columns: 1fr; text-align: center; }
  .hero-image { order: -1; max-width: 480px; margin: 0 auto; }
}

/* Page hero with image */
.page-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  margin-bottom: 48px;
}
.page-hero-image img {
  width: 100%;
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.service-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
  margin: 56px 0;
  padding: 32px 0;
  border-bottom: 1px solid var(--border);
}
.service-block.reverse { direction: rtl; }
.service-block.reverse > * { direction: ltr; }
.service-image {
  width: 100%;
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.service-text h2 { margin-top: 0; }

@media (max-width: 800px) {
  .page-hero, .service-block, .service-block.reverse {
    grid-template-columns: 1fr;
    direction: ltr;
  }
}

/* How We Work page */
.process-image {
  margin: 32px 0 40px;
  text-align: center;
}
.process-image img {
  max-width: 100%;
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.audience-blocks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-top: 48px;
}
.audience-block {
  background: var(--white);
  padding: 24px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.audience-block img {
  width: 100%;
  border-radius: 12px;
  margin-bottom: 16px;
}
.audience-block h3 { margin-top: 0; color: var(--navy); }

@media (max-width: 800px) {
  .audience-blocks { grid-template-columns: 1fr; }
}

/* Mobile menu */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  flex-direction: column;
  gap: 5px;
}
.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--navy);
  transition: 0.3s;
}
.menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

.mobile-lang { display: none; }
.desktop-lang { display: block; }

@media (max-width: 768px) {
  .menu-toggle { display: flex; }
  .desktop-lang { display: none; }
  .mobile-lang { display: block; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }

  .header-inner {
    flex-wrap: nowrap;
    padding: 14px 0;
  }

  .main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    z-index: 999;
  }
  .main-nav.open { max-height: 400px; padding: 16px 0 20px; }

  .main-nav ul {
    flex-direction: column;
    gap: 0;
    padding: 0 24px;
  }
  .main-nav li { border-bottom: 1px solid var(--border); }
  .main-nav li:last-child { border-bottom: none; }
  .main-nav a {
    display: block;
    padding: 14px 0;
    font-size: 1rem;
  }
  .main-nav a::after { display: none; }

  body.menu-open { overflow: hidden; }
}

/* Sector pages */
.sector-banner {
  width: 100%;
  max-height: 420px;
  overflow: hidden;
  margin-bottom: 0;
}
.sector-banner img {
  width: 100%;
  height: 420px;
  object-fit: cover;
  display: block;
}
.sector-page .page-content { padding-top: 48px; }

/* Partners page */
.partners-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 32px 0 28px;
}
.filter-btn {
  background: var(--white);
  border: 1px solid var(--border);
  padding: 8px 18px;
  border-radius: 20px;
  cursor: pointer;
  font-weight: 500;
  color: var(--navy);
  transition: all 0.2s;
}
.filter-btn.active,
.filter-btn:hover {
  background: var(--teal);
  color: var(--white);
  border-color: var(--teal);
}
.partners-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}
.partner-card {
  background: var(--white);
  padding: 28px 24px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: transform 0.2s;
}
.partner-card:hover { transform: translateY(-4px); }
.partner-logo {
  width: 56px;
  height: 56px;
  background: var(--navy);
  color: var(--white);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 16px;
}
.partner-card h3 { margin: 0 0 4px; color: var(--navy); }
.partner-cat {
  color: var(--teal);
  font-size: 0.85rem;
  font-weight: 600;
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.partner-card p:last-child { margin: 0; color: var(--text-muted); font-size: 0.95rem; }

/* Dropdown arrow for menu items with children */
.main-nav .menu-item-has-children > a::after {
  content: '';
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 6px;
  vertical-align: middle;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  transition: transform 0.2s;
}
.main-nav .menu-item-has-children:hover > a::after,
.main-nav .menu-item-has-children.open > a::after {
  transform: rotate(180deg);
}

/* Submenu styling */
.main-nav .sub-menu {
  display: none;
  position: absolute;
  background: var(--white);
  min-width: 220px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  border-radius: 8px;
  padding: 8px 0;
  z-index: 1000;
  list-style: none;
  margin: 0;
}
.main-nav .menu-item-has-children { position: relative; }
.main-nav .menu-item-has-children:hover > .sub-menu,
.main-nav .menu-item-has-children.open > .sub-menu {
  display: block;
}
.main-nav .sub-menu a {
  display: block;
  padding: 10px 20px;
  color: var(--navy);
  font-weight: 500;
}
.main-nav .sub-menu a:hover { background: var(--bg); color: var(--teal); }
.main-nav .sub-menu a::after { display: none; }

@media (max-width: 768px) {
  .main-nav .sub-menu {
    position: static;
    box-shadow: none;
    background: transparent;
    padding-left: 16px;
  }
  .main-nav .menu-item-has-children > a::after {
    float: right;
    margin-top: 6px;
  }
}

/* ===== MOBILE FIXES ===== */

/* Page content padding – prevent text on edge */
.page-content,
.sector-page .page-content,
.partners-page {
  padding-left: 20px;
  padding-right: 20px;
}
.page-content .container,
.sector-page .container {
  padding-left: 16px;
  padding-right: 16px;
}

/* Responsive banners / illustrations */
.sector-banner {
  max-height: none;
  height: auto;
}
.sector-banner img,
.hero-image img,
.service-image,
.page-hero-image img,
.process-image img,
.audience-block img {
  width: 100%;
  height: auto;
  max-height: 280px;
  object-fit: cover;
  object-position: center;
  display: block;
}
.hero-image img {
  max-height: 220px;
  border-radius: 12px;
}

/* Mobile menu – full height scrollable */
@media (max-width: 768px) {
  .main-nav {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: none;
    height: calc(100vh - 64px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: var(--white);
    padding: 8px 0 40px;
    z-index: 999;
    box-shadow: none;
  }
  .main-nav.open {
    max-height: none;
    height: calc(100vh - 64px);
  }
  .main-nav ul {
    padding: 0 20px;
  }
  .main-nav li {
    border-bottom: 1px solid var(--border);
  }
  .main-nav a {
    padding: 16px 0;
    font-size: 1.05rem;
  }
  .mobile-lang {
    display: block !important;
    margin: 20px 20px 0;
    padding: 16px 0;
    border-top: 1px solid var(--border);
    font-size: 1rem;
  }
  .mobile-lang a {
    font-weight: 600;
    margin: 0 6px;
  }
  .mobile-lang a.current-lang {
    color: var(--teal);
    text-decoration: underline;
  }

  /* Submenu full visibility */
  .main-nav .sub-menu {
    position: static;
    display: none;
    background: var(--bg);
    box-shadow: none;
    border-radius: 0;
    padding: 0 0 8px 16px;
    margin: 0;
  }
  .main-nav .menu-item-has-children.open > .sub-menu {
    display: block;
  }
  .main-nav .sub-menu a {
    padding: 12px 0;
    font-size: 0.98rem;
  }

  /* Prevent body scroll when menu open */
  body.menu-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
  }

  /* Hero text adjustments */
  .hero-content {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 24px;
  }
  .hero-text h1 { font-size: 2.2rem; }
  .hero { padding: 48px 0 40px; }

  /* Cards and service blocks */
  .cards { grid-template-columns: 1fr; }
  .service-block,
  .service-block.reverse,
  .page-hero,
  .audience-blocks {
    grid-template-columns: 1fr;
    direction: ltr;
    gap: 20px;
  }
  .service-image,
  .page-hero-image img {
    max-height: 200px;
  }
}

/* Extra small screens */
@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .page-content { padding-top: 32px; }
  .sector-banner img { max-height: 180px; }
  .btn { padding: 12px 24px; font-size: 0.9rem; }
}

/* ===== MOBILE MENU FIX – hide by default ===== */
@media (max-width: 768px) {
  .main-nav {
    display: none;
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    bottom: 0;
    height: calc(100vh - 64px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: var(--white);
    padding: 8px 0 40px;
    z-index: 999;
    box-shadow: none;
  }
  .main-nav.open {
    display: block;
  }

  /* Language switcher inline */
  .mobile-lang {
    display: flex !important;
    align-items: center;
    gap: 8px;
    margin: 20px 20px 0;
    padding: 16px 0;
    border-top: 1px solid var(--border);
    font-size: 1rem;
  }
  .mobile-lang a {
    font-weight: 600;
  }
  .mobile-lang a.current-lang {
    color: var(--teal);
    text-decoration: underline;
  }
}

/* ===== BLOG / INSIGHTS ===== */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
  margin-top: 32px;
}
.post-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: transform 0.2s;
}
.post-card:hover { transform: translateY(-4px); }
.post-thumb img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}
.post-card-body { padding: 24px; }
.post-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0 0 8px;
}
.post-card h2 {
  margin: 0 0 12px;
  font-size: 1.25rem;
}
.post-card h2 a { color: var(--navy); }
.post-card h2 a:hover { color: var(--teal); }
.post-excerpt { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 16px; }
.read-more {
  font-weight: 600;
  color: var(--teal);
}
.read-more:hover { color: var(--teal-light); }

.single-post .post-featured {
  margin: 24px 0 32px;
  border-radius: 12px;
  overflow: hidden;
}
.single-post .post-featured img {
  width: 100%;
  height: auto;
  max-height: 420px;
  object-fit: cover;
}
.single-post .entry-content {
  font-size: 1.05rem;
  line-height: 1.75;
}
.single-post .entry-content h2 { margin-top: 1.8em; }
.single-post .entry-content h3 { margin-top: 1.4em; color: var(--teal); }
.single-post .entry-content ul,
.single-post .entry-content ol { margin-bottom: 1.4em; }
.post-tags { margin-top: 32px; font-size: 0.9rem; color: var(--text-muted); }
.post-navigation {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.post-navigation a { font-weight: 500; }
.pagination { margin-top: 40px; text-align: center; }
.pagination .nav-links { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.pagination a,
.pagination span {
  padding: 8px 14px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--white);
}
.pagination .current { background: var(--teal); color: var(--white); border-color: var(--teal); }

@media (max-width: 768px) {
  .posts-grid { grid-template-columns: 1fr; }
  .post-navigation { flex-direction: column; }
}
