/* ============================================================
   HAITHAM ELHUSSEINY – Career Platform
   Complete design system for the dynamic app.js implementation
   Design tokens match the original teal/gold aesthetic
   ============================================================ */

/* ── Reset & Tokens ── */
*,*::before,*::after{box-sizing:border-box}
html{scroll-behavior:smooth}
body{margin:0;font-family:Inter,'Segoe UI',Arial,sans-serif;font-size:16px;line-height:1.6;background:#fbfaf6;color:#23363a}
h1,h2,h3,h4,h5{font-family:Georgia,'Times New Roman',serif;line-height:1.1;margin-top:0;color:#0c282e}
p{margin-top:0}
a{color:#1a6d70;text-decoration:none}
a:hover{text-decoration:underline}
img{max-width:100%;display:block}
ul{margin:0;padding:0 0 0 1.3em}
li{margin:6px 0}

:root {
  --ink:   #0c282e;
  --ink2:  #153b42;
  --teal:  #1a6d70;
  --gold:  #d3ad61;
  --sand:  #f2eee5;
  --paper: #fbfaf6;
  --line:  #d8dfdc;
  --text:  #23363a;
  --muted: #647477;
  --white: #fff;
  --shadow: 0 22px 70px rgba(3,27,31,.14);
  --radius: 20px;
}

.wrap{width:min(1160px,calc(100% - 40px));margin:auto}

/* ── Buttons ── */
.btn{display:inline-flex;align-items:center;gap:7px;padding:13px 26px;border-radius:999px;font-size:14px;font-weight:700;text-decoration:none;cursor:pointer;border:0;transition:.18s transform,.18s box-shadow}
.btn:hover{transform:translateY(-2px);text-decoration:none}
.btn-primary{background:var(--gold);color:var(--ink);box-shadow:0 10px 30px rgba(211,173,97,.28)}
.btn-primary:hover{box-shadow:0 14px 40px rgba(211,173,97,.38)}
.btn-secondary{background:transparent;border:2px solid var(--ink);color:var(--ink)}
.btn-secondary:hover{background:var(--ink);color:#fff}
.btn-sm{padding:7px 16px;font-size:13px}
.btn-ghost{background:rgba(255,255,255,.12);color:#fff;border:1px solid rgba(255,255,255,.35)}
.btn-ghost:hover{background:rgba(255,255,255,.22)}

/* ── Navigation ── */
#main-nav{
  position:sticky;top:0;z-index:50;
  display:flex;align-items:center;justify-content:space-between;
  padding:0 max(20px,calc((100vw - 1160px)/2));
  height:72px;
  background:rgba(251,250,246,.96);backdrop-filter:blur(14px);
  border-bottom:1px solid rgba(12,40,46,.08);
}
.nav-logo{
  font-family:Georgia,serif;font-size:22px;font-weight:900;
  color:var(--ink);letter-spacing:-.01em;
}
.nav-logo:hover{text-decoration:none;color:var(--teal)}
.nav-links{display:flex;gap:28px}
.nav-links a{color:var(--text);font-size:13px;font-weight:700;text-decoration:none}
.nav-links a:hover{color:var(--teal)}
.nav-actions{display:flex;gap:10px;align-items:center}
.lang-btn{
  border:1px solid var(--line);background:#fff;color:var(--ink);
  border-radius:999px;padding:8px 14px;font-weight:800;font-size:12px;cursor:pointer;
  transition:.15s;
}
.lang-btn:hover{background:var(--ink);color:#fff}

/* ── Hero ── */
#hero{
  background:var(--ink);
  padding:90px max(20px,calc((100vw - 1160px)/2));
  min-height:580px;
  display:flex;align-items:center;
}
.hero-inner{max-width:820px;color:#fff}
.hero-tag{
  display:inline-block;
  font-size:11px;font-weight:800;letter-spacing:.14em;text-transform:uppercase;
  color:var(--gold);margin-bottom:18px;
}
h1.hero-name{font-size:clamp(38px,6vw,70px);color:#fff;margin-bottom:12px}
.hero-subtitle{font-size:20px;color:#b8cbc8;margin-bottom:18px}
.hero-lead{font-size:17px;color:#ccdad8;max-width:680px;margin-bottom:36px;line-height:1.65}
.hero-metrics{
  display:flex;gap:0;flex-wrap:wrap;
  border-top:1px solid rgba(255,255,255,.15);border-bottom:1px solid rgba(255,255,255,.15);
  margin-bottom:36px;padding:20px 0;
}
.metric{
  flex:1;min-width:110px;
  display:flex;flex-direction:column;align-items:center;
  padding:0 20px;border-right:1px solid rgba(255,255,255,.12);
}
.metric:last-child{border-right:0}
.metric strong{font-family:Georgia,serif;font-size:36px;color:var(--gold);line-height:1}
.metric span{font-size:11px;color:#8fa8a5;text-align:center;margin-top:5px;text-transform:uppercase;letter-spacing:.06em}
.hero-cta{display:flex;gap:14px;flex-wrap:wrap}

/* ── Sections (shared wrappers) ── */
.section-inner{width:min(1160px,calc(100% - 40px));margin:auto;padding:80px 0}
.section-alt{background:var(--sand)}
.section-dark{background:var(--ink);color:#dce5e4}
.section-dark h2{color:#fff}
.section-contact{background:var(--gold)}
.section-header{display:flex;align-items:baseline;justify-content:space-between;margin-bottom:36px;flex-wrap:wrap;gap:10px}
.section-header h2{margin:0;font-size:clamp(28px,4vw,42px)}
.view-all-link{font-size:13px;font-weight:700;color:var(--teal)}
.view-all-link:hover{text-decoration:underline}

/* Default section styling for the IDs app.js targets */
#featured,#expertise,#credentials,#insights,#resources,#contact{
  padding:80px max(20px,calc((100vw - 1160px)/2));
}
#featured{background:#fff}
#expertise{background:var(--sand)}
#credentials{background:#fff}
#timeline{background:var(--ink);padding:80px max(20px,calc((100vw - 1160px)/2))}
#timeline h2{color:#fff}
#insights{background:var(--sand)}
#resources{background:#fff}
#contact{background:var(--gold)}

/* ── Project Cards ── */
.projects-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:20px}
.project-card{
  background:#fff;border-radius:var(--radius);overflow:hidden;
  cursor:pointer;transition:.2s box-shadow,.2s transform;
  box-shadow:0 4px 20px rgba(12,40,46,.07);
}
.project-card:hover{box-shadow:var(--shadow);transform:translateY(-3px)}
.card-img{position:relative;height:200px;background:linear-gradient(135deg,#1b6970,#102f36);overflow:hidden}
.card-img img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;transition:transform .4s}
.project-card:hover .card-img img{transform:scale(1.06)}
.card-img-placeholder{
  position:absolute;inset:0;
  display:flex;align-items:center;justify-content:center;
  background:linear-gradient(135deg,#1b6970,#0d2f34);
  font-family:Georgia,serif;font-size:48px;color:rgba(255,255,255,.18);
}
.card-sector{
  position:absolute;top:12px;left:12px;
  background:rgba(12,40,46,.82);backdrop-filter:blur(4px);
  color:#fff;font-size:10px;font-weight:800;text-transform:uppercase;letter-spacing:.07em;
  padding:4px 10px;border-radius:999px;
}
.card-body{padding:20px}
h3.card-title{font-size:18px;margin-bottom:8px;color:var(--ink);line-height:1.2}
.card-meta{display:flex;gap:12px;font-size:12px;color:var(--muted);margin-bottom:10px}
.card-desc{font-size:13px;color:var(--muted);line-height:1.55;margin-bottom:12px;
  display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.card-footer{display:flex;align-items:center;justify-content:space-between;padding-top:12px;border-top:1px solid var(--line)}
.card-company{font-size:12px;color:var(--muted);font-weight:600}
.card-link{font-size:12px;font-weight:700;color:var(--teal)}

/* FIDIC badge on card-img */
.contract-badge{
  position:absolute;bottom:10px;left:10px;
  background:rgba(15,52,96,.92);color:#fff;
  font-size:9px;font-weight:700;padding:4px 8px;border-radius:4px;
  letter-spacing:.04em;backdrop-filter:blur(4px);
}

/* ── Expertise ── */
#expertise h2{font-size:clamp(28px,4vw,40px);margin-bottom:36px}
.expertise-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:16px}
.expertise-card{
  background:#fff;border:1px solid var(--line);border-radius:18px;
  padding:24px;transition:.2s box-shadow;
}
.expertise-card:hover{box-shadow:0 8px 32px rgba(12,40,46,.1)}
.expertise-card h4{font-size:16px;margin-bottom:8px;color:var(--ink)}
.expertise-card p{font-size:13px;color:var(--muted);margin:0;line-height:1.55}

/* ── Credentials ── */
#credentials h2{font-size:clamp(28px,4vw,40px);margin-bottom:36px}
.credentials-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:16px}
.credential-card{
  display:flex;gap:16px;align-items:flex-start;
  background:var(--sand);border:1px solid var(--line);border-radius:18px;padding:20px;
}
.cred-badge{
  font-family:Georgia,serif;font-size:26px;font-weight:900;
  color:var(--teal);min-width:50px;text-align:center;
  background:#fff;border-radius:12px;padding:10px;line-height:1;
}
.cred-body h4{font-size:15px;margin-bottom:4px;color:var(--ink)}
.cred-issuer{font-size:12px;color:var(--muted);margin-bottom:4px}
.cred-dates{font-size:11px;color:var(--teal);font-weight:700;margin:0}
.cred-visual{flex-shrink:0}
.cred-thumb{width:100px;height:auto;border-radius:8px;cursor:pointer;display:block;transition:opacity .2s}
.cred-thumb:hover{opacity:.85}
/* Task #31 Fix: PMI-CP certificate was scanned upside-down */
img.cred-thumb[src*="cert-pmi-cp"]{transform:rotate(90deg)}

/* ── Career Timeline ── */
#timeline h2{margin-bottom:36px}
.timeline{position:relative;padding-left:30px}
.timeline::before{
  content:'';position:absolute;left:8px;top:0;bottom:0;
  width:2px;background:rgba(255,255,255,.2);
}
.timeline-item{
  position:relative;
  padding:0 0 24px 28px;display:flex;gap:24px;align-items:flex-start;
}
.timeline-item::before{
  content:'';position:absolute;left:-4px;top:22px;
  width:12px;height:12px;border-radius:50%;
  background:var(--gold);border:3px solid var(--ink);
}
.timeline-period{
  flex-shrink:0;width:110px;
  font-size:12px;font-weight:800;color:var(--gold);
  padding-top:18px;line-height:1.3;
}
.timeline-body{
  background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.12);
  border-radius:14px;padding:18px 20px;flex:1;
}
.timeline-body h4{font-size:16px;margin-bottom:6px;color:#fff}
.timeline-company{font-size:13px;color:#8fa8a5;margin:0}
.timeline-country{color:#b8cbc8;font-size:11px;margin-left:8px}

/* ── Insights ── */
#insights h2{font-size:clamp(28px,4vw,40px);margin-bottom:36px}
.insights-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:18px}
.insight-card{
  background:#fff;border:1px solid var(--line);border-radius:18px;
  padding:22px;transition:.2s box-shadow;
}
.insight-card:hover{box-shadow:0 8px 32px rgba(12,40,46,.1)}
.insight-meta{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:12px;flex-wrap:wrap}
.insight-category{font-size:10px;font-weight:800;text-transform:uppercase;letter-spacing:.08em;color:var(--teal)}
.insight-status{font-size:10px;font-weight:700;padding:3px 9px;border-radius:999px}
.insight-status.planned{background:#f3f4f6;color:#6b7280}
.insight-status.in-development{background:#fef3c7;color:#92400e}
.insight-status.available{background:#d1fae5;color:#065f46}
.insight-card h4{font-size:16px;color:var(--ink);margin-bottom:8px}
.insight-card p{font-size:13px;color:var(--muted);margin:0;line-height:1.55}

/* ── Resources ── */
#resources h2{font-size:clamp(28px,4vw,40px)}
.section-lead{max-width:720px;margin:0 auto 36px;text-align:center;color:var(--muted);font-size:1.02rem;line-height:1.7}
.resources-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(270px,1fr));gap:20px;margin-top:32px}
.resource-card{
  background:#fff;border:1px solid var(--line);border-radius:16px;
  padding:26px 22px;transition:.2s box-shadow,.2s transform;position:relative;
}
.resource-card:hover{box-shadow:0 8px 32px rgba(12,40,46,.09);transform:translateY(-2px)}
.resource-card.resource-in-development{border-left:3px solid #f59e0b}
.resource-card.resource-planned{border-left:3px solid #9ca3af;opacity:.85}
.resource-card.resource-available{border-left:3px solid #10b981}
.resource-header{display:flex;align-items:center;gap:10px;margin-bottom:14px;flex-wrap:wrap}
.resource-icon{font-size:1.3rem}
.resource-category{font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.08em;color:var(--muted);flex:1}
.resource-status{font-size:10px;font-weight:700;padding:3px 9px;border-radius:999px;white-space:nowrap}
.resource-status.in-development{background:#fef3c7;color:#92400e}
.resource-status.planned{background:#f3f4f6;color:#6b7280}
.resource-status.available{background:#d1fae5;color:#065f46}
h4.resource-title{font-size:15px;font-weight:700;color:var(--ink);margin:0 0 8px;line-height:1.3}
.resource-desc{font-size:13px;color:var(--muted);line-height:1.6;margin:0 0 14px}
.resources-note{margin-top:36px;text-align:center;color:var(--muted);font-size:13px;max-width:640px;margin-left:auto;margin-right:auto}

/* ── Contact ── */
#contact{background:var(--gold);text-align:center}
#contact h2{font-size:clamp(28px,4vw,42px);color:var(--ink);margin-bottom:12px}
#contact p{color:rgba(12,40,46,.75);max-width:600px;margin:0 auto 30px;font-size:17px}
.contact-links{display:flex;gap:14px;flex-wrap:wrap;justify-content:center}
.contact-links .btn-secondary{border-color:var(--ink)}

/* ── Footer ── */
#site-footer{background:var(--ink);color:#d5dfde;padding:28px 0;text-align:center}
#site-footer p{margin:0;font-size:12px;color:#8fa8a5}

/* ── Projects Page ── */
#projects-page{padding:60px max(20px,calc((100vw - 1160px)/2))}
.page-header{margin-bottom:32px}
.page-header h1{font-size:clamp(32px,5vw,52px)}
.sector-filters{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:28px}
.filter-btn{
  border:1px solid var(--line);background:#fff;color:var(--text);
  border-radius:999px;padding:9px 16px;font-size:12px;font-weight:700;
  cursor:pointer;transition:.15s;
}
.filter-btn:hover{border-color:var(--teal);color:var(--teal)}
.filter-btn.active{background:var(--teal);border-color:var(--teal);color:#fff}

/* ── Project Detail ── */
.project-detail{max-width:860px}
.back-link{
  display:inline-block;margin-bottom:28px;
  font-size:13px;font-weight:700;color:var(--teal);
}
.back-link:hover{text-decoration:underline}
.detail-header{margin-bottom:32px}
.detail-sector{
  font-size:11px;font-weight:800;text-transform:uppercase;letter-spacing:.1em;
  color:var(--teal);margin-bottom:10px;
}
.detail-header h1{font-size:clamp(28px,5vw,48px);margin-bottom:14px}
.detail-meta{
  display:flex;gap:16px;flex-wrap:wrap;
  font-size:13px;color:var(--muted);margin-bottom:14px;
}
.detail-meta span:not(:last-child)::after{content:'·';margin-left:16px;color:var(--line)}
.detail-contract{
  display:inline-block;margin-top:10px;
  padding:10px 16px;background:#eff6ff;border:1px solid #bfdbfe;
  border-radius:8px;font-size:13px;color:#1e40af;
}
.detail-gallery{
  display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:12px;
  margin-bottom:36px;
}
.detail-gallery img{border-radius:14px;height:180px;object-fit:cover;width:100%}
.detail-section{margin-bottom:36px;padding-bottom:36px;border-bottom:1px solid var(--line)}
.detail-section:last-child{border-bottom:0}
.detail-section h2{font-size:22px;margin-bottom:14px}
.detail-section p{color:var(--muted);line-height:1.7}
.detail-section ul{color:var(--muted);padding-left:20px}
.detail-section li{margin:8px 0;line-height:1.6}
.expertise-tags h2{margin-bottom:16px}
.tag-list{display:flex;flex-wrap:wrap;gap:8px}
.tag{
  background:#edf4f3;color:var(--teal);
  border:1px solid #c5dedd;border-radius:999px;
  padding:6px 12px;font-size:12px;font-weight:700;
}

/* ── CV Page ── */
#cv-page{padding:60px max(20px,calc((100vw - 1160px)/2))}
.cv-container{max-width:860px}
.cv-header{
  background:var(--ink);border-radius:var(--radius);
  padding:48px;margin-bottom:48px;color:#fff;
}
.cv-header h1{font-size:clamp(28px,5vw,46px);color:#fff;margin-bottom:8px}
.cv-subtitle{font-size:18px;color:var(--gold);margin-bottom:14px}
.cv-lead{font-size:14px;color:#cddad8;max-width:640px;margin-bottom:28px;line-height:1.6}
.cv-section{margin-bottom:48px}
.cv-section h2{font-size:26px;color:var(--ink);margin-bottom:20px;padding-bottom:10px;border-bottom:2px solid var(--gold)}
.credentials-list{display:flex;flex-direction:column;gap:10px}
.cv-credential{
  display:flex;align-items:baseline;gap:10px;
  padding:12px 16px;background:var(--sand);border-radius:10px;
  font-size:14px;color:var(--text);
}
.cv-credential strong{color:var(--teal);min-width:60px;flex-shrink:0}
.cred-meta{display:block;font-size:11px;color:var(--muted);margin-top:2px}
.experience-list{display:flex;flex-direction:column;gap:24px}
.cv-experience{display:flex;gap:24px;padding-bottom:24px;border-bottom:1px solid var(--line)}
.cv-experience:last-child{border-bottom:0}
.exp-period{
  min-width:110px;flex-shrink:0;
  font-size:12px;font-weight:700;color:var(--teal);
  padding-top:3px;
}
.exp-body h4{font-size:16px;margin-bottom:4px;color:var(--ink)}
.exp-company{font-size:13px;color:var(--muted);margin-bottom:8px}
.exp-projects{list-style:disc;padding-left:18px;color:var(--muted);font-size:13px}
.exp-projects li{margin:4px 0}
.cv-education{
  display:flex;justify-content:space-between;align-items:flex-start;
  background:var(--sand);padding:18px 20px;border-radius:14px;
}
.cv-education strong{font-size:15px;color:var(--ink)}
.cv-education p{font-size:13px;color:var(--muted);margin:4px 0 0}
.skills-grid{display:flex;flex-wrap:wrap;gap:8px}
.skill-tag{
  background:#edf4f3;color:var(--ink);
  border:1px solid #c5dedd;border-radius:999px;
  padding:8px 14px;font-size:12px;font-weight:700;
}

/* ── Responsive ── */
@media(max-width:1000px){
  .projects-grid{grid-template-columns:repeat(2,1fr)}
  .expertise-grid{grid-template-columns:repeat(2,1fr)}
  .credentials-grid{grid-template-columns:1fr}
  .insights-grid{grid-template-columns:repeat(2,1fr)}
}
@media(max-width:768px){
  #main-nav{padding:0 16px}
  .nav-links{display:none}
  #hero{padding:64px 20px}
  .hero-metrics{gap:0}
  .metric{min-width:80px;padding:0 12px}
  .metric strong{font-size:28px}
  #featured,#expertise,#credentials,#insights,#resources,#contact,#timeline{
    padding:56px 20px;
  }
  .projects-grid{grid-template-columns:1fr}
  .expertise-grid{grid-template-columns:1fr}
  .insights-grid{grid-template-columns:1fr}
  .credentials-grid{grid-template-columns:1fr}
  #projects-page{padding:40px 20px}
  #cv-page{padding:40px 20px}
  .cv-experience{flex-direction:column;gap:8px}
  .exp-period{min-width:auto}
  .cv-header{padding:28px 22px}
  .timeline{padding-left:20px}
  .timeline-item{flex-direction:column;gap:8px}
  .timeline-period{width:auto;padding-top:0}
}
@media(max-width:480px){
  .hero-metrics{flex-wrap:wrap;justify-content:center}
  .metric{flex:0 0 45%;border-right:0;border-bottom:1px solid rgba(255,255,255,.12);padding:14px}
  .metric:nth-child(odd){border-right:1px solid rgba(255,255,255,.12)}
  .metric:nth-last-child(-n+2){border-bottom:0}
}

/* ── RTL Support ── */
[dir="rtl"] .timeline{padding-left:0;padding-right:30px}
[dir="rtl"] .timeline::before{left:auto;right:8px}
[dir="rtl"] .timeline-item{padding-left:0;padding-right:28px}
[dir="rtl"] .timeline-item::before{left:auto;right:-4px}
[dir="rtl"] .timeline-country{margin-left:0;margin-right:8px}
[dir="rtl"] .back-link{direction:rtl}
[dir="rtl"] .resource-card.resource-in-development{border-left:none;border-right:3px solid #f59e0b}
[dir="rtl"] .resource-card.resource-planned{border-left:none;border-right:3px solid #9ca3af}
[dir="rtl"] .resource-card.resource-available{border-left:none;border-right:3px solid #10b981}
[dir="rtl"] .contract-badge{left:auto;right:10px}
[dir="rtl"] #main-nav{flex-direction:row-reverse}
[dir="rtl"] .nav-links{flex-direction:row-reverse}
[dir="rtl"] .card-footer{flex-direction:row-reverse}
[dir="rtl"] .detail-meta span:not(:last-child)::after{margin-left:0;margin-right:16px}
[dir="rtl"] .cv-experience{flex-direction:row-reverse}
[dir="rtl"] .credential-card{flex-direction:row-reverse}

/* ── Print ── */
@media print{
  #main-nav,#site-footer,#contact,.hero-cta,.btn{display:none!important}
  #hero{min-height:auto;padding:30px 0}
  .hero-name{font-size:32px}
}

/* ── Placeholder sector colours ── */
.card-img-placeholder.buildings{background:linear-gradient(135deg,#1b4f5a,#2d7a6e)}
.card-img-placeholder.commercial{background:linear-gradient(135deg,#3b2d4d,#6b4c8a)}
.card-img-placeholder.education{background:linear-gradient(135deg,#1e4a3d,#2d7a55)}
.card-img-placeholder.infrastructure{background:linear-gradient(135deg,#2d3a4d,#4a6080)}
.card-img-placeholder.residential{background:linear-gradient(135deg,#4d2d2d,#8a4c4c)}
.card-img-placeholder.industrial{background:linear-gradient(135deg,#2d3a1e,#4a6028)}
.card-img-placeholder.sports{background:linear-gradient(135deg,#1e3a5f,#2d6a9f)}
