/*
Theme Name: Wealth Engineering
Theme URI: https://example.com/wealth-engineering
Author: Custom Theme
Author URI: https://example.com
Description: Professional dark-themed WordPress theme for engineering and safety consulting firms. Features a navy/gold color palette, custom post types for Services and Projects, and a sophisticated layout designed for industrial businesses.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: wealth-engineering
Tags: dark, business, professional, custom-colors, custom-menu, custom-logo, featured-images, threaded-comments
*/

/* ============================================
   CSS VARIABLES - Brand colors
   ============================================ */
:root {
  --color-bg: #0a1830;
  --color-bg-alt: #0d1d3a;
  --color-bg-card: #142647;
  --color-gold: #d4a142;
  --color-gold-light: #e8b85a;
  --color-text: #ffffff;
  --color-text-muted: #b8c2d4;
  --color-text-dim: #8a93a8;
  --color-border: #1f3358;

  --font-display: 'Montserrat', 'Helvetica Neue', sans-serif;
  --font-body: 'Inter', 'Helvetica Neue', sans-serif;

  --container-max: 1280px;
  --section-padding: 80px;
  --radius: 4px;
  --transition: 0.3s ease;
}

/* ============================================
   RESET & BASE
   ============================================ */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: var(--color-gold);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover { color: var(--color-gold-light); }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

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

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 2px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--color-gold);
  color: var(--color-bg);
}
.btn-primary:hover {
  background-color: var(--color-gold-light);
  color: var(--color-bg);
  transform: translateY(-2px);
}

.btn-outline {
  background-color: transparent;
  color: var(--color-text);
  border-color: var(--color-text);
}
.btn-outline:hover {
  background-color: var(--color-text);
  color: var(--color-bg);
}

.btn-gold-outline {
  background-color: transparent;
  color: var(--color-gold);
  border-color: var(--color-gold);
}
.btn-gold-outline:hover {
  background-color: var(--color-gold);
  color: var(--color-bg);
}

.btn .arrow { transition: transform var(--transition); }
.btn:hover .arrow { transform: translateX(4px); }

/* ============================================
   HEADER
   ============================================ */
.site-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 16px 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  text-decoration: none;
}

/* Force constrain ANY logo image — overrides inline styles and WP defaults */
/* Logo is horizontal (~1.7:1) — constrain by HEIGHT, let width follow */
.site-logo img,
.site-logo .custom-logo,
.site-header img,
.site-header .custom-logo,
.header-inner img {
  height: 72px !important;
  max-height: 72px !important;
  width: auto !important;
  max-width: 220px !important;
  object-fit: contain !important;
  display: block !important;
}

.site-logo .custom-logo-link,
.site-header .custom-logo-link {
  display: inline-block;
  line-height: 0;
  flex-shrink: 0;
}

.logo-mark {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-gold);
  color: var(--color-bg);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 32px;
  flex-shrink: 0;
  border-radius: 4px;
}

.logo-text {
  font-family: var(--font-display);
  line-height: 1.1;
  color: var(--color-text);
  white-space: nowrap;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.logo-text-name {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.5px;
}
.logo-text small {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  color: var(--color-gold);
}

/* Hide logo text on small mobile to save space */
@media (max-width: 600px) {
  .logo-text { display: none; }
}

.main-nav ul {
  list-style: none;
  display: flex;
  gap: 28px;
  align-items: center;
  flex-wrap: nowrap;
}

.main-nav a {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text);
  position: relative;
  padding: 8px 0;
  white-space: nowrap;
}

.main-nav .current-menu-item a,
.main-nav a:hover { color: var(--color-gold); }

.main-nav .current-menu-item a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--color-gold);
}

/* Login / My Portal menu item — subtle outlined accent */
.main-nav .menu-item-login a {
  border: 1px solid rgba(212, 161, 66, 0.4);
  padding: 6px 14px;
  border-radius: var(--radius);
  transition: all var(--transition);
}
.main-nav .menu-item-login a:hover {
  background-color: rgba(212, 161, 66, 0.1);
  border-color: var(--color-gold);
}
.main-nav .menu-item-login.current-menu-item a {
  background-color: var(--color-gold);
  color: var(--color-bg) !important;
  border-color: var(--color-gold);
}
.main-nav .menu-item-login.current-menu-item a::after {
  display: none;
}
.main-nav .menu-item-logged-in a {
  background-color: rgba(212, 161, 66, 0.1);
  color: var(--color-gold);
  border-color: var(--color-gold);
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--color-text);
  cursor: pointer;
  padding: 8px;
}

/* ============================================
   HERO
   ============================================ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 140px 0 80px;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(10, 24, 48, 0.95) 0%, rgba(10, 24, 48, 0.75) 25%, rgba(10, 24, 48, 0.2) 50%, transparent 75%),
    linear-gradient(180deg, rgba(10, 24, 48, 0.3) 0%, transparent 30%, transparent 70%, rgba(10, 24, 48, 0.6) 100%);
  z-index: 2;
}

/* Subtle pattern over the hero for added depth */
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 80% 30%, rgba(212, 161, 66, 0.06) 0%, transparent 50%);
  z-index: 2;
  pointer-events: none;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 1;
}
.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

.hero-content {
  position: relative;
  z-index: 3;
  max-width: 480px;
}

.hero-eyebrow {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-gold);
  margin-bottom: 24px;
}

.hero-title {
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.1;
  margin-bottom: 24px;
  font-weight: 800;
  text-shadow: 0 2px 12px rgba(10, 24, 48, 0.6);
}

.hero-description {
  font-size: 16px;
  color: var(--color-text-muted);
  margin-bottom: 40px;
  max-width: 460px;
  text-shadow: 0 1px 6px rgba(10, 24, 48, 0.7);
}

.hero-buttons {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* ============================================
   FEATURES STRIP
   ============================================ */
.features-strip {
  background-color: var(--color-bg-alt);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  padding: 32px 0;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-right: 24px;
  border-right: 1px solid var(--color-border);
}
.feature-item:last-child { border-right: none; }

/* Clickable feature items */
.feature-item-link {
  text-decoration: none;
  color: inherit;
  transition: transform 0.3s ease, opacity 0.3s ease;
  cursor: pointer;
}
.feature-item-link:hover {
  transform: translateY(-2px);
  opacity: 0.85;
}
.feature-item-link:hover .feature-icon {
  color: var(--color-gold-light);
}

.feature-icon {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  color: var(--color-gold);
}
.feature-icon svg { width: 100%; height: 100%; display: block; }

.feature-text {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  line-height: 1.3;
}

/* ============================================
   SECTIONS
   ============================================ */
.section { padding: var(--section-padding) 0; }

.section-header {
  text-align: center;
  margin-bottom: 60px;
}

.section-title {
  font-size: clamp(28px, 4vw, 42px);
  display: inline-flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 12px;
}

.section-title::before,
.section-title::after {
  content: '';
  width: 60px;
  height: 1px;
  background-color: var(--color-gold);
}

.section-subtitle {
  color: var(--color-text-muted);
  font-size: 16px;
}

/* ============================================
   SERVICES GRID
   ============================================ */
.services-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 24px;
}

.service-card {
  text-align: center;
  padding: 24px 16px;
  transition: transform var(--transition);
  cursor: pointer;
}
.service-card:hover { transform: translateY(-4px); }

.service-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  color: var(--color-gold);
}
.service-icon svg { width: 100%; height: 100%; display: block; }

.service-name {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
}

/* ============================================
   ABOUT SECTION
   ============================================ */
.about-section {
  background-color: var(--color-bg-alt);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.about-images {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.about-images img {
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius);
}

.about-eyebrow {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-gold);
  margin-bottom: 16px;
}

.about-title {
  font-size: clamp(28px, 3.5vw, 38px);
  margin-bottom: 24px;
}

.about-description {
  color: var(--color-text-muted);
  margin-bottom: 32px;
}

/* ============================================
   PROJECTS
   ============================================ */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-bottom: 40px;
}

.project-card {
  background-color: var(--color-bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform var(--transition);
}
.project-card:hover { transform: translateY(-4px); }

.project-image {
  aspect-ratio: 16/10;
  overflow: hidden;
}
.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.project-card:hover .project-image img { transform: scale(1.05); }

.project-image-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0a1830 0%, #14264a 100%);
}
.project-image-placeholder svg {
  width: 56px;
  height: 56px;
  color: var(--color-gold);
  opacity: 0.55;
}

.blog-section { background: var(--color-bg-alt, #0d1d3a); }

.project-content { padding: 20px; }

.project-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}

.project-category {
  color: var(--color-text-muted);
  font-size: 14px;
  margin-bottom: 12px;
}

.project-date {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--color-gold);
  font-size: 13px;
}
.project-date svg {
  width: 14px !important;
  height: 14px !important;
  flex-shrink: 0;
}

.projects-cta { text-align: center; }

/* ============================================
   STATS
   ============================================ */
.stats-section {
  padding: 40px 0 80px;
}

.stats-box {
  background-color: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 32px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-right: 24px;
  border-right: 1px solid var(--color-border);
}
.stat-item:last-child { border-right: none; }

.stat-icon {
  width: 48px;
  height: 48px;
  color: var(--color-gold);
  flex-shrink: 0;
}
.stat-icon svg { width: 100%; height: 100%; display: block; }

.stat-number {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label {
  color: var(--color-text-muted);
  font-size: 13px;
  font-family: var(--font-display);
  font-weight: 500;
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
  background-color: var(--color-bg-alt);
  border-top: 1px solid var(--color-border);
  padding: 60px 0 24px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-about {
  color: var(--color-text-muted);
  font-size: 14px;
  margin: 24px 0;
}

.footer-social {
  display: flex;
  gap: 12px;
}

.footer-social a {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-gold);
  border-radius: 50%;
  color: var(--color-gold);
  transition: all var(--transition);
}
.footer-social a:hover {
  background-color: var(--color-gold);
  color: var(--color-bg);
}

.footer-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.footer-links {
  list-style: none;
}
.footer-links li { margin-bottom: 12px; }
.footer-links a {
  color: var(--color-text-muted);
  font-size: 14px;
}
.footer-links a:hover { color: var(--color-gold); }
.footer-links li.active a { color: var(--color-gold); }

.footer-contact-item {
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
  color: var(--color-text-muted);
  font-size: 14px;
}

.footer-contact-icon {
  width: 20px;
  height: 20px;
  color: var(--color-gold);
  flex-shrink: 0;
  margin-top: 2px;
}
.footer-contact-icon svg { width: 100%; height: 100%; display: block; }

.footer-bottom {
  border-top: 1px solid var(--color-border);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--color-text-dim);
  font-size: 13px;
}

.back-to-top {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--color-text-muted);
}
.back-to-top:hover { color: var(--color-gold); }

/* ============================================
   PAGE CONTENT (default page.php)
   ============================================ */
.page-hero {
  padding: 160px 0 60px;
  background-color: var(--color-bg-alt);
  border-bottom: 1px solid var(--color-border);
  text-align: center;
}

.page-content {
  padding: 60px 0;
}

.page-content .container {
  max-width: 900px;
}

.page-content p { margin-bottom: 1.2em; color: var(--color-text-muted); }
.page-content h2 { margin: 2em 0 0.5em; }

/* Constrain any image / SVG inside content — prevents oversized icons */
.page-content img,
.page-content svg {
  max-width: 100%;
  height: auto;
}
.page-content svg {
  max-width: 80px;
  max-height: 80px;
}
.page-content figure { margin: 1.5em 0; }
.page-content figure img { border-radius: var(--radius); }

/* Blog post content — richer styling */
.post-content { font-size: 17px; line-height: 1.8; }
.post-content p { margin-bottom: 1.4em; color: var(--color-text); }
.post-content h2 {
  margin: 1.8em 0 0.6em;
  font-size: 26px;
  color: var(--color-text);
  padding-left: 14px;
  border-left: 4px solid var(--color-gold);
}
.post-content h3 { margin: 1.4em 0 0.5em; font-size: 21px; color: var(--color-text); }
.post-content ul, .post-content ol { margin: 0 0 1.4em 1.4em; color: var(--color-text); }
.post-content li { margin-bottom: 0.5em; line-height: 1.7; }
.post-content img { border-radius: var(--radius); margin: 1.5em 0; }
.post-content a { color: var(--color-gold); text-decoration: underline; }
.post-content blockquote {
  border-left: 4px solid var(--color-gold);
  padding: 8px 0 8px 20px;
  margin: 1.5em 0;
  font-style: italic;
  color: var(--color-text-muted);
}
.post-content figcaption {
  text-align: center;
  font-size: 14px;
  color: var(--color-text-muted);
  margin-top: 8px;
}

/* Post meta date icon — keep small */
.post-meta-icon {
  display: inline-flex;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.post-meta-icon svg { width: 100%; height: 100%; display: block; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .services-grid { grid-template-columns: repeat(3, 1fr); }
  .projects-grid { grid-template-columns: repeat(2, 1fr); }
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 24px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .about-grid { grid-template-columns: 1fr; }

  .feature-item:nth-child(2) { border-right: none; }
  .stat-item:nth-child(2) { border-right: none; }
}

@media (max-width: 768px) {
  :root { --section-padding: 60px; }

  .menu-toggle { display: block; }

  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--color-bg);
    padding: 24px;
    border-top: 1px solid var(--color-border);
  }
  .main-nav.is-open { display: block; }
  .main-nav ul { flex-direction: column; align-items: flex-start; gap: 16px; }

  .header-cta { display: none; }

  .hero { min-height: 80vh; padding: 120px 0 60px; }
  .hero::before {
    background: linear-gradient(180deg, rgba(10, 24, 48, 0.7) 0%, var(--color-bg) 100%);
  }

  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .projects-grid { grid-template-columns: 1fr; }

  .section-title::before, .section-title::after { width: 30px; }

  .footer-bottom { flex-direction: column; gap: 12px; text-align: center; }
}

@media (max-width: 480px) {
  .features-grid { grid-template-columns: 1fr; }
  .feature-item { border-right: none; border-bottom: 1px solid var(--color-border); padding-bottom: 16px; padding-right: 0; }
  .feature-item:last-child { border-bottom: none; }

  .stats-grid { grid-template-columns: 1fr; }
  .stat-item { border-right: none; }

  .footer-grid { grid-template-columns: 1fr; }

  .hero-buttons { flex-direction: column; align-items: stretch; }
  .btn { justify-content: center; }
}
