/*
Theme Name: Salah Structural
Theme URI: https://salahstructural.com
Description: Professional bilingual structural engineering blog - Arabic/English
Author: Abdulrahman Salah
Version: 1.0
Text Domain: salah-structural
*/

/* =====================================================
   GOOGLE FONTS - Cairo Arabic
   ===================================================== */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;900&family=Inter:wght@400;500;600;700&display=swap');

/* =====================================================
   CSS VARIABLES
   ===================================================== */
:root {
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --blue-light: #dbeafe;
  --navy: #1e3a5f;
  --text: #111827;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --bg: #ffffff;
  --bg-soft: #f9fafb;
  --radius: 10px;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-hover: 0 8px 30px rgba(37,99,235,0.15);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Cairo', 'Inter', sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  direction: rtl;
}

body.ltr-page { direction: ltr; }

img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-decoration: none; transition: color .2s; }
a:hover { color: var(--blue-dark); }

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

/* =====================================================
   HEADER
   ===================================================== */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 8px rgba(0,0,0,0.06);
}

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

.site-logo {
  font-size: 20px;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.3px;
}
.site-logo span { color: var(--blue); }

.site-nav { display: flex; gap: 4px; align-items: center; }

.site-nav a {
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 8px;
  transition: all .2s;
}
.site-nav a:hover,
.site-nav a.active {
  color: var(--blue);
  background: var(--blue-light);
}

.nav-cta {
  background: var(--blue) !important;
  color: #fff !important;
  padding: 8px 18px !important;
  border-radius: 8px !important;
}
.nav-cta:hover { background: var(--blue-dark) !important; }

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

/* =====================================================
   HERO
   ===================================================== */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, #1e40af 100%);
  color: #fff;
  padding: 80px 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero-content { position: relative; max-width: 700px; margin: 0 auto; }

.hero-badge {
  display: inline-block;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 20px;
  margin-bottom: 20px;
  letter-spacing: 0.5px;
}

.hero h1 {
  font-size: clamp(28px, 5vw, 48px);
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 16px;
}

.hero p {
  font-size: 18px;
  opacity: 0.85;
  margin-bottom: 32px;
  max-width: 550px;
  margin-left: auto;
  margin-right: auto;
}

.hero-buttons { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  font-family: 'Cairo', sans-serif;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all .2s;
}

.btn-primary { background: #fff; color: var(--blue); }
.btn-primary:hover { background: var(--blue-light); color: var(--blue-dark); }

.btn-outline { border-color: rgba(255,255,255,0.5); color: #fff; }
.btn-outline:hover { background: rgba(255,255,255,0.1); border-color: #fff; color: #fff; }

.btn-blue { background: var(--blue); color: #fff; }
.btn-blue:hover { background: var(--blue-dark); color: #fff; }

/* =====================================================
   SECTION TITLES
   ===================================================== */
.section { padding: 64px 0; }
.section-alt { background: var(--bg-soft); }

.section-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 8px;
}

.section-subtitle {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 36px;
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 32px;
}

.section-header .view-all {
  font-size: 13px;
  font-weight: 600;
  color: var(--blue);
}

/* =====================================================
   ARTICLE CARDS
   ===================================================== */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.article-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all .25s;
  display: flex;
  flex-direction: column;
}

.article-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
  border-color: var(--blue-light);
}

.article-card-img {
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--bg-soft);
}

.article-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s;
}

.article-card:hover .article-card-img img { transform: scale(1.04); }

.article-card-body { padding: 20px; flex: 1; display: flex; flex-direction: column; }

.article-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.tag {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--blue-light);
  color: var(--blue);
  letter-spacing: 0.3px;
}

.lang-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.article-date {
  font-size: 12px;
  color: var(--text-muted);
  margin-right: auto;
}

.article-card h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
  line-height: 1.5;
}

.article-card p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
  flex: 1;
}

.article-card-footer {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.read-more {
  font-size: 13px;
  font-weight: 700;
  color: var(--blue);
  display: flex;
  align-items: center;
  gap: 4px;
}

.read-time { font-size: 12px; color: var(--text-muted); }

/* =====================================================
   TOOLS GRID (App Store Style)
   ===================================================== */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
}

.tool-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  transition: all .25s;
  display: block;
  text-decoration: none;
}

.tool-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-4px);
  border-color: var(--blue);
  color: inherit;
}

.tool-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  font-size: 28px;
}

.tool-icon-blue { background: linear-gradient(135deg, #2563eb, #3b82f6); }
.tool-icon-green { background: linear-gradient(135deg, #059669, #10b981); }
.tool-icon-purple { background: linear-gradient(135deg, #7c3aed, #8b5cf6); }
.tool-icon-orange { background: linear-gradient(135deg, #d97706, #f59e0b); }
.tool-icon-red { background: linear-gradient(135deg, #dc2626, #ef4444); }
.tool-icon-teal { background: linear-gradient(135deg, #0d9488, #14b8a6); }

.tool-card h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
  line-height: 1.4;
}

.tool-card p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

.tool-badge {
  display: inline-block;
  margin-top: 10px;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
}

.badge-free { background: #f0fdf4; color: #15803d; }
.badge-new { background: #eff6ff; color: #1d4ed8; }

/* =====================================================
   ABOUT STRIP
   ===================================================== */
.about-strip {
  background: linear-gradient(135deg, var(--navy), #1e40af);
  color: #fff;
  padding: 56px 0;
}

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

.about-strip h2 { font-size: 26px; font-weight: 800; margin-bottom: 14px; }
.about-strip p { opacity: 0.85; font-size: 15px; line-height: 1.8; }

.about-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.about-tag {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 20px;
}

/* =====================================================
   ARTICLES PAGE
   ===================================================== */
.page-header {
  background: var(--bg-soft);
  padding: 48px 0;
  border-bottom: 1px solid var(--border);
}

.page-header h1 { font-size: 32px; font-weight: 900; color: var(--navy); margin-bottom: 8px; }
.page-header p { color: var(--text-muted); font-size: 16px; }

.filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}

.filter-btn {
  padding: 7px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  font-family: 'Cairo', sans-serif;
  border: 1.5px solid var(--border);
  background: #fff;
  color: var(--text-muted);
  cursor: pointer;
  transition: all .2s;
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

/* =====================================================
   SINGLE TOOL PAGE
   ===================================================== */
.tool-page-header {
  background: var(--bg-soft);
  padding: 32px 0;
  border-bottom: 1px solid var(--border);
}

.tool-breadcrumb {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.tool-breadcrumb a { color: var(--blue); }

.tool-page-header h1 {
  font-size: 26px;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 6px;
}

.tool-container {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin: 32px 0;
  box-shadow: var(--shadow);
}

.tool-container iframe {
  width: 100%;
  border: none;
  display: block;
}

/* =====================================================
   FOOTER
   ===================================================== */
.site-footer {
  background: var(--navy);
  color: rgba(255,255,255,0.8);
  padding: 48px 0 24px;
}

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

.footer-brand .site-logo { color: #fff; margin-bottom: 12px; display: block; }
.footer-brand p { font-size: 14px; opacity: 0.7; line-height: 1.7; }

.footer-col h4 { color: #fff; font-size: 14px; font-weight: 700; margin-bottom: 16px; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 8px; }
.footer-col ul li a { font-size: 14px; color: rgba(255,255,255,0.65); transition: color .2s; }
.footer-col ul li a:hover { color: #fff; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: rgba(255,255,255,0.5);
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 768px) {
  .site-nav { display: none; }
  .site-nav.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 64px;
    left: 0; right: 0;
    background: #fff;
    padding: 12px;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    gap: 4px;
  }
  .menu-toggle { display: block; }

  .about-strip-inner { grid-template-columns: 1fr; gap: 24px; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .section-header { flex-direction: column; align-items: flex-start; gap: 8px; }
  .hero p { font-size: 16px; }
  .tools-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .tools-grid { grid-template-columns: repeat(2, 1fr); }
  .articles-grid { grid-template-columns: 1fr; }
}
