/* ────────────────────────────────────────────
   EngineAI Global Styles
   Colors: #0D1B2A (dark bg), #2563eb (primary improved), #4CAF50 (success)
   ──────────────────────────────────────────── */

/* ── CSS Reset & Base ── */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Colors - Improved contrast */
  --bg-dark: #0D1B2A;
  --bg-card: #1E293B;
  --bg-light: #f8fafc;
  --text-primary: #F1F5F9; /* Lighter for better contrast */
  --text-secondary: #CBD5E1; /* Improved contrast */
  --text-muted: #94A3B8; /* Better contrast */
  --border: #334155;
  --primary: #2563eb; /* Darker blue for better contrast */
  --primary-hover: #1d4ed8;
  --success: #4CAF50;
  --success-hover: #45a049;
  --gradient-primary: linear-gradient(90deg, #3B82F6, #8B5CF6);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 6px 16px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.4);
  --radius: 12px;
  --radius-lg: 16px;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.6;
  font-size: 16px;
}

a {
  text-decoration: none;
  color: var(--primary);
}
a:hover {
  text-decoration: underline;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ── Typography ── */
.h1, h1 { font-size: 2.5rem; font-weight: 700; line-height: 1.2; margin-bottom: 1rem; }
.h2, h2 { font-size: 2rem; font-weight: 700; margin: 2rem 0 1.25rem; }
.h3, h3 { font-size: 1.5rem; font-weight: 600; margin: 1.5rem 0 1rem; }
p { margin-bottom: 1.25rem; color: var(--text-secondary); }
strong { color: var(--text-primary); }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0.85rem 1.75rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.25s ease;
  border: none;
  text-decoration: none;
}

/* 🔥 CRITICAL FIX: Improved button contrast */
.btn-primary {
  background: var(--primary);
  color: white !important; /* Force white text for contrast */
}
.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.btn-secondary {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}
.btn-secondary:hover {
  background: rgba(37, 99, 235, 0.1);
  transform: translateY(-2px);
}

.btn-success {
  background: var(--success);
  color: white;
}
.btn-success:hover {
  background: var(--success-hover);
}

/* ── Header ── */
.site-header {
  background: var(--bg-dark);
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.logo {
  font-size: 1.8rem;
  font-weight: 700;
  text-decoration: none;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.tagline {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.main-nav ul {
  display: flex;
  list-style: none;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
}

.main-nav a {
  color: var(--text-secondary);
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.main-nav a:hover,
.main-nav a.active {
  color: white;
  background: rgba(59, 130, 246, 0.2);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 5px;
  width: 36px;
  height: 30px;
  z-index: 1001;
}

.mobile-menu-toggle span {
  display: block;
  height: 3px;
  width: 100%;
  background: var(--text-primary);
  margin-bottom: 5px;
  border-radius: 2px;
  transition: all 0.3s ease;
}

.mobile-menu-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: rotate(45deg) translate(8px, 8px);
}

.mobile-menu-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: rotate(-45deg) translate(8px, -8px);
}

@media (max-width: 768px) {
  .mobile-menu-toggle { display: flex; }
  .main-nav ul {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-dark);
    flex-direction: column;
    padding: 1.5rem 0;
    box-shadow: var(--shadow-lg);
    display: none;
  }
  .main-nav ul.show { display: flex; }
  .main-nav li { text-align: center; width: 100%; }
  .main-nav a { display: block; padding: 12px 0; margin: 0 20px; border-radius: 8px; }
}

/* ── Card Component ── */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
  border: 1px solid var(--border);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: rgba(96, 165, 250, 0.3);
}

/* ✅ CRITICAL FIX: .card-image — full height, no crop */
.card-image,
.article-content img {
  width: 100% !important;
  height: auto !important;
  max-height: none !important;
  display: block;
  margin: 1.5rem auto;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  cursor: zoom-in;
  transition: transform 0.2s ease;
}

.card-image:hover,
.article-content img:hover {
  transform: scale(1.01);
}

.card-content {
  padding: 1.5rem;
}

.card-title {
  font-size: 1.35rem;
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

.card-title a {
  color: var(--text-primary);
  text-decoration: none;
}
.card-title a:hover {
  color: var(--primary);
}

/* 🔥 CRITICAL FIX: Improved card meta contrast */
.card-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

/* 🔥 CRITICAL FIX: Improved card excerpt contrast */
.card-excerpt {
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
  line-height: 1.6;
}

.card-link {
  color: var(--primary);
  font-weight: 600; /* Bolder for better contrast */
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}
.card-link:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

/* ── Grid Layouts ── */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.grid-auto {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-auto {
    grid-template-columns: 1fr;
  }
}

/* ── Section Styles ── */
.section {
  padding: 3rem 0;
}
.section-title {
  text-align: center;
  margin-bottom: 2.5rem;
}
.section-title h2 {
  color: white;
}

.hero {
  text-align: center;
  padding: 4rem 0 3rem;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  margin-bottom: 2.5rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.hero h1 {
  font-size: 2.8rem;
  margin-bottom: 1rem;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  color: var(--text-secondary);
  max-width: 700px;
  margin: 0 auto 1.5rem;
  font-size: 1.1rem;
}

/* ── Footer ── */
.site-footer {
  background: var(--bg-dark);
  color: var(--text-secondary);
  padding: 3rem 0 1.5rem;
  margin-top: 3rem;
  border-top: 1px solid var(--border);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-section h3,
.footer-section h4 {
  color: var(--text-primary);
  margin-bottom: 1rem;
  font-size: 1.15rem;
}

.footer-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.footer-section li { margin-bottom: 0.6rem; }
.footer-section a {
  color: var(--text-secondary);
  transition: color 0.2s;
}
.footer-section a:hover {
  color: var(--primary);
}

.social-links {
  display: flex;
  gap: 12px;
  margin-top: 12px;
}
.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(96, 165, 250, 0.1);
  color: var(--primary);
  transition: all 0.3s ease;
}
.social-links a:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-2px);
}

.footer-bottom {
  text-align: center;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
}
.footer-bottom a {
  color: var(--primary);
}

/* ── Form Elements ── */
.form-group {
  margin-bottom: 1.5rem;
}
label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
  font-weight: 500;
}
.required::after {
  content: " *";
  color: #f87171;
}
input, textarea, select {
  width: 100%;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.7);
  color: white;
  font-size: 1rem;
  font-family: inherit;
  transition: all 0.2s ease;
}
input:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}
input::placeholder, textarea::placeholder {
  color: var(--text-muted);
}
textarea {
  min-height: 160px;
  resize: vertical;
}

/* ── Messages ── */
.message {
  padding: 1rem;
  border-radius: 10px;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.message.success {
  background: rgba(76, 175, 80, 0.15);
  border: 1px solid var(--success);
  color: #6ee7b7;
}
.message.error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid #ef4444;
  color: #fca5a5;
}
.message i { font-size: 1.3rem; margin-top: 3px; }

/* ── Breadcrumb ── */
.breadcrumb {
  background: rgba(30, 41, 59, 0.4);
  padding: 1rem 0;
  margin: 1.5rem 0;
  border-radius: var(--radius);
}
.breadcrumb a { color: var(--primary); }
.breadcrumb span { color: var(--text-muted); }

/* ── Article Content ── */
.article-content {
  margin-top: 1.5rem;
  line-height: 1.7;
  font-size: 1.05rem;
}

.article-content h1,
.article-content h2,
.article-content h3 {
  color: var(--text-primary);
  margin: 1.8rem 0 1rem;
}

.article-content p {
  margin-bottom: 1.2rem;
}

/* 🔥 CRITICAL FIX: Improved link contrast in paragraphs */
.article-content a,
.text-center a,
.section a:not(.btn):not(.card-link):not(.card-title a) {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 500;
}

.article-content a:hover,
.text-center a:hover,
.section a:not(.btn):not(.card-link):not(.card-title a):hover {
  color: var(--primary-hover);
  text-decoration-thickness: 2px;
}

/* 🔥 LIGHTBOX — FULL SIZE, NO CROP */
#lightbox-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 99999;
  opacity: 0;
  transition: opacity 0.3s ease;
}
#lightbox-overlay.active {
  display: flex;
  opacity: 1;
}
#lightbox-img {
  max-width: 95%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}
#lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  color: white;
  font-size: 2rem;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.4);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
#lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Responsive */
@media (max-width: 768px) {
  #lightbox-img {
    max-width: 98%;
    max-height: 85vh;
  }
}

/* ── Responsive Utilities ── */
.text-center { text-align: center; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

/* 🔥 CRITICAL FIX: Cookie consent button contrast */
.accept-btn {
  background: var(--primary) !important;
  color: white !important;
}

.decline-btn {
  background: #e5e7eb !important;
  color: #1f2937 !important;
}
